diff options
-rw-r--r-- | .vscode/settings.json | 6 | ||||
-rw-r--r-- | script/core/hover/init.lua | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json index 248a92a6..31b3626c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,7 +12,8 @@ "DBGPORT", "DBGWAIT", "tracy", - "LOCALE" + "LOCALE", + "SHOWSOURCE" ], "Lua.diagnostics.disable": [ "close-non-object", @@ -43,5 +44,6 @@ "?.lua", "script/?.lua", "script/?/init.lua" - ] + ], + "Lua.misc.parameters": "--showsource=true" } diff --git a/script/core/hover/init.lua b/script/core/hover/init.lua index 81285ef2..0c8644ed 100644 --- a/script/core/hover/init.lua +++ b/script/core/hover/init.lua @@ -155,6 +155,14 @@ local function getHoverByUri(uri, offset) return nil end local hover = getHover(source) + if SHOWSOURCE then + hover.description = ('%s\n---\n\n```lua\n%s\n```'):format( + hover.description or '', + util.dump(source, { + deep = 1, + }) + ) + end return hover end |