diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/core/document_symbol.lua | 2 | ||||
-rw-r--r-- | server/src/core/hover/hover.lua | 2 | ||||
-rw-r--r-- | server/src/vm/vm.lua | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/server/src/core/document_symbol.lua b/server/src/core/document_symbol.lua index e4b3c3b8..47389ec2 100644 --- a/server/src/core/document_symbol.lua +++ b/server/src/core/document_symbol.lua @@ -84,7 +84,7 @@ local function buildSet(source, callback) return end local kind - if value:getType() == 'function' then + if value:getFunction() then local func = value:getFunction() if func:getObject() then kind = SymbolKind.Field diff --git a/server/src/core/hover/hover.lua b/server/src/core/hover/hover.lua index e07acf4a..2e87936c 100644 --- a/server/src/core/hover/hover.lua +++ b/server/src/core/hover/hover.lua @@ -137,7 +137,7 @@ local function getValueHover(source, name, value, lib) local tip local literal if lib then - value = lib.code or (lib.value and ('%q'):format(lib.value)) + literal = lib.code or (lib.value and ('%q'):format(lib.value)) tip = lib.description else literal = value:getLiteral() and ('%q'):format(value:getLiteral()) diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index 50deb7e9..9e89c6e6 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -311,6 +311,7 @@ function mt:call(value, values, source) if not func then return end + self:instantSource(source) if lib then self:callLibrary(func, values, source, lib) else @@ -437,8 +438,11 @@ function mt:unpackList(list) end function mt:getFirstInMulti(multi) + if not multi then + return multi + end if multi.type == 'multi' then - return multi[1] + return self:getFirstInMulti(multi[1]) else return multi end @@ -449,6 +453,7 @@ function mt:getSimple(simple, max) local first = simple[1] self:instantSource(first) local value = self:getExp(first) + value = self:getFirstInMulti(value) or createValue('nil') first:bindValue(value, 'get') if not max then max = #simple |