diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-17 22:44:08 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-17 22:44:08 +0800 |
commit | ca24380b0ead49aa28d44af959f780a58cbe9699 (patch) | |
tree | c70bf4fb2d1c282daa28dd13f675a36a03a1b4d7 | |
parent | 07c3230d29cb7b2660d6027733756c8e4adb591e (diff) | |
download | lua-language-server-ca24380b0ead49aa28d44af959f780a58cbe9699.zip |
强制字面量
-rw-r--r-- | server/libs/lua53/utf8.lni | 2 | ||||
-rw-r--r-- | server/src/matcher/hover.lua | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/libs/lua53/utf8.lni b/server/libs/lua53/utf8.lni index effd9814..855abd61 100644 --- a/server/libs/lua53/utf8.lni +++ b/server/libs/lua53/utf8.lni @@ -26,7 +26,7 @@ type = 'string' [charpattern] type = 'string' -value = [=[[\0-\x7F\xC2-\xF4][\x80-\xBF]*]=] +code = [=['[\0-\x7F\xC2-\xF4][\x80-\xBF]*']=] [codes] [[.args]] diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua index 497bc528..41dccd39 100644 --- a/server/src/matcher/hover.lua +++ b/server/src/matcher/hover.lua @@ -330,10 +330,10 @@ local function getValueHover(name, valueType, result, source, lib) local value local tip if lib then - value = lib.value + value = lib.code or (lib.value and ('%q'):format(lib.value)) tip = lib.description or '' else - value = result.value.value + value = result.value.value and ('%q'):format(result.value.value) tip = '' end @@ -341,7 +341,7 @@ local function getValueHover(name, valueType, result, source, lib) if value == nil then text = ('%s %s'):format(valueType, name) else - text = ('%s %s = %q'):format(valueType, name, value) + text = ('%s %s = %s'):format(valueType, name, value) end return ([[ ```lua |