summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-17 22:44:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-17 22:44:08 +0800
commitca24380b0ead49aa28d44af959f780a58cbe9699 (patch)
treec70bf4fb2d1c282daa28dd13f675a36a03a1b4d7
parent07c3230d29cb7b2660d6027733756c8e4adb591e (diff)
downloadlua-language-server-ca24380b0ead49aa28d44af959f780a58cbe9699.zip
强制字面量
-rw-r--r--server/libs/lua53/utf8.lni2
-rw-r--r--server/src/matcher/hover.lua6
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