Skip to content

Commit

Permalink
fix #718
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Oct 11, 2021
1 parent d4a863d commit c726389
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 2.4.3
* `FIX` [#713](https://github.com/sumneko/lua-language-server/issues/713)
* `FIX` [#718](https://github.com/sumneko/lua-language-server/issues/718)

## 2.4.2
`2021-10-8`
Expand Down
12 changes: 10 additions & 2 deletions script/core/semantic-tokens.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c726389

Please sign in to comment.