summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-08-11 21:04:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-08-11 21:04:00 +0800
commita88c6796f2ab2ac3b3ff2419ab1cfdcb5518013f (patch)
tree3b2c22638c49f898e4737e38087f49add89eb37b
parent96e26a0ffebd3806d509453827c722c630b59f2a (diff)
downloadlua-language-server-a88c6796f2ab2ac3b3ff2419ab1cfdcb5518013f.zip
dont show `nil.XXX`
-rw-r--r--script/core/infer.lua3
-rw-r--r--test/hover/init.lua8
2 files changed, 10 insertions, 1 deletions
diff --git a/script/core/infer.lua b/script/core/infer.lua
index 5bf8a5f2..8ac585f4 100644
--- a/script/core/infer.lua
+++ b/script/core/infer.lua
@@ -672,7 +672,8 @@ function m.getClass(source)
end
end
local view = m.viewInfers(infers)
- if view == 'any' then
+ if view == 'any'
+ or view == 'nil' then
return nil
end
return view
diff --git a/test/hover/init.lua b/test/hover/init.lua
index 4f339c87..9dc9a9a8 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -1671,3 +1671,11 @@ function f1.f2.<?f3?>() end
[[
function f1.f2.f3()
]]
+
+TEST [[
+local t = nil
+t.<?x?>()
+]]
+[[
+field t.x: any
+]]