diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-08 14:30:12 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-08 14:30:12 +0800 |
commit | 0b898555f495b80f278fec01d2f3e6ec83b4952c (patch) | |
tree | aed287373390fe6fe856b44f2c05da3e9a5af4d0 | |
parent | 3771e70b48e9a088cbdc11a8b952d525eea1e7c9 (diff) | |
download | lua-language-server-0b898555f495b80f278fec01d2f3e6ec83b4952c.zip |
fix
-rw-r--r-- | script/core/hover/description.lua | 3 | ||||
-rw-r--r-- | test/hover/init.lua | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua index e3acd07d..7b32c41c 100644 --- a/script/core/hover/description.lua +++ b/script/core/hover/description.lua @@ -56,6 +56,9 @@ end local function asStringView(source, literal) -- 内部包含转义符? + if not source[2] then + return + end local rawLen = source.finish - source.start - 2 * #source[2] if config.get(guide.getUri(source), 'Lua.hover.viewString') and (source[2] == '"' or source[2] == "'") diff --git a/test/hover/init.lua b/test/hover/init.lua index 5ee4db51..2ae6837f 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -1737,7 +1737,7 @@ TEST [[ ---@class A local a -local b = nil +local b b = a print(b.<?x?>) @@ -1809,3 +1809,10 @@ local <?uri?> [[ local uri: string ]] + +TEST [[ +local <?x?> = '1' .. '2' +]] +[[ +local x: string = "12" +]] |