diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-10-11 13:12:42 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-10-11 13:12:42 +0800 |
commit | c72638938a8991ac9c977895463f35391d82265b (patch) | |
tree | 83a287e765e0af3ae1095d2fd685d06cc30976f6 /script | |
parent | d4a863d3c238714f12e94f4cb42990c48f4862a0 (diff) | |
download | lua-language-server-c72638938a8991ac9c977895463f35391d82265b.zip |
fix #718
Diffstat (limited to 'script')
-rw-r--r-- | script/core/semantic-tokens.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua index 517eb25b..ef2bc9b4 100644 --- a/script/core/semantic-tokens.lua +++ b/script/core/semantic-tokens.lua @@ -16,11 +16,10 @@ Care['getglobal'] = function (source, results) local isLib = vm.isGlobalLibraryName(source[1]) local isFunc = false local value = source.value - local next = source.next if value and value.type == 'function' then isFunc = true - elseif next and next.type == 'call' then + elseif source.parent.type == 'call' then isFunc = true elseif isEnhanced then isFunc = infer.hasType(source, 'function') @@ -75,6 +74,15 @@ Care['field'] = function (source, results) } return end + if source.parent.parent.type == 'call' then + results[#results+1] = { + start = source.start, + finish = source.finish, + type = define.TokenTypes.method, + modifieres = modifiers, + } + return + end results[#results+1] = { start = source.start, finish = source.finish, |