diff options
author | Kevin Hahn <hahn.kev@gmail.com> | 2022-08-01 23:32:13 +0700 |
---|---|---|
committer | Kevin Hahn <hahn.kev@gmail.com> | 2022-08-02 10:07:22 +0700 |
commit | b3589ccaaa3729ff8d2c05142a4a1bb2c847522f (patch) | |
tree | b80dc1311fbbe40685f6edda20f5037db0f3e202 /script/core | |
parent | eecbfae0e6d846f20bc836b5ee8a706501b2db40 (diff) | |
download | lua-language-server-b3589ccaaa3729ff8d2c05142a4a1bb2c847522f.zip |
allow table fields assigned to local functions to show as functions in autocomplete
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/completion/completion.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index 2b806314..53919f51 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -485,7 +485,7 @@ local function checkFieldFromFieldToIndex(state, name, src, parent, word, startP end local function checkFieldThen(state, name, src, word, startPos, position, parent, oop, results) - local value = vm.getObjectValue(src) or src + local value = vm.getObjectFunctionValue(src) or src local kind = define.CompletionItemKind.Field if value.type == 'function' or value.type == 'doc.type.function' then @@ -565,7 +565,8 @@ local function checkFieldOfRefs(refs, state, word, startPos, position, parent, o end local funcLabel if config.get(state.uri, 'Lua.completion.showParams') then - local value = vm.getObjectValue(src) or src + --- TODO determine if getlocal should be a function here too + local value = vm.getObjectFunctionValue(src) or src if value.type == 'function' or value.type == 'doc.type.function' then funcLabel = name .. getParams(value, oop) |