summaryrefslogtreecommitdiff
path: root/script/vm/infer.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/infer.lua')
-rw-r--r--script/vm/infer.lua19
1 files changed, 13 insertions, 6 deletions
diff --git a/script/vm/infer.lua b/script/vm/infer.lua
index 94fdfd88..f2673ed3 100644
--- a/script/vm/infer.lua
+++ b/script/vm/infer.lua
@@ -386,9 +386,11 @@ function mt:_computeViews(uri)
self.views = {}
for n in self.node:eachObject() do
- local view = viewNodeSwitch(n.type, n, self, uri)
- if view then
- self.views[view] = true
+ if not n.hideView then
+ local view = viewNodeSwitch(n.type, n, self, uri)
+ if view then
+ self.views[view] = true
+ end
end
end
@@ -565,11 +567,12 @@ function vm.viewKey(source, uri)
return vm.viewKey(source.types[1], uri)
else
local key = vm.getInfer(source):view(uri)
- return '[' .. key .. ']'
+ return '[' .. key .. ']', key
end
end
if source.type == 'tableindex'
- or source.type == 'setindex' then
+ or source.type == 'setindex'
+ or source.type == 'getindex' then
local index = source.index
local name = vm.getInfer(index):viewLiterals()
if not name then
@@ -587,7 +590,11 @@ function vm.viewKey(source, uri)
return vm.viewKey(source.name, uri)
end
if source.type == 'doc.type.name' then
- return '[' .. source[1] .. ']'
+ return '[' .. source[1] .. ']', source[1]
+ end
+ if source.type == 'doc.type.string' then
+ local name = util.viewString(source[1], source[2])
+ return ('[%s]'):format(name), name
end
local key = vm.getKeyName(source)
if key == nil then