summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-01-31 16:11:27 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-01-31 16:11:27 +0800
commit26b94a3743cf264ec2fad975f95c33069b37c4e3 (patch)
tree26c4f86e5295ac3bc40f0b1b4a764d0ff669c9a2 /script/vm
parent27e0563a12df66990bc7ce2a782c30a93194aafc (diff)
downloadlua-language-server-26b94a3743cf264ec2fad975f95c33069b37c4e3.zip
improve label in hover
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/infer.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/script/vm/infer.lua b/script/vm/infer.lua
index 2f482116..3045bbdb 100644
--- a/script/vm/infer.lua
+++ b/script/vm/infer.lua
@@ -451,7 +451,8 @@ function mt:view(uri, default)
if #array == 0 then
view = 'nil'
else
- if max > 1 then
+ if max > 1
+ or view:find(guide.notNamePattern .. guide.namePattern .. '$') then
view = '(' .. view .. ')?'
else
view = view .. '?'