diff options
Diffstat (limited to 'server/src/matcher')
-rw-r--r-- | server/src/matcher/hover.lua | 8 | ||||
-rw-r--r-- | server/src/matcher/library.lua | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua index f546734a..0db15bf8 100644 --- a/server/src/matcher/hover.lua +++ b/server/src/matcher/hover.lua @@ -324,23 +324,27 @@ local function getValueHover(name, valueType, result, source, lib) end local value + local tip if lib then value = lib.value + tip = lib.description or '' else value = result.value.value + tip = '' end local text if value == nil then text = ('%s %s'):format(valueType, name) else - text = ('%s %s = %s'):format(valueType, name, value) + text = ('%s %s = %q'):format(valueType, name, value) end return ([[ ```lua %s ``` -]]):format(text) +%s +]]):format(text, tip) end return function (vm, pos) diff --git a/server/src/matcher/library.lua b/server/src/matcher/library.lua index f6211431..5b150513 100644 --- a/server/src/matcher/library.lua +++ b/server/src/matcher/library.lua @@ -10,11 +10,17 @@ local function mergeEnum(lib, locale) if enum.enum then pack[enum.enum] = enum end + if enum.code then + pack[enum.code] = enum + end end for _, enum in ipairs(locale) do if pack[enum.enum] then pack[enum.enum].description = enum.description end + if pack[enum.code] then + pack[enum.code].description = enum.description + end end end |