diff options
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/core/semantic-tokens.lua | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/changelog.md b/changelog.md index d70e8a19..9d88fed2 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ `FIX` [#479](https://github.com/sumneko/lua-language-server/issues/479) `FIX` [#483](https://github.com/sumneko/lua-language-server/issues/483) `FIX` [#485](https://github.com/sumneko/lua-language-server/issues/485) +`FIX` [#487](https://github.com/sumneko/lua-language-server/issues/487) ## 1.20.2 `2021-4-2` diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua index 17e3b386..f8feaa09 100644 --- a/script/core/semantic-tokens.lua +++ b/script/core/semantic-tokens.lua @@ -68,7 +68,12 @@ Care['getlocal'] = function (source, results) and source.parent.node == source then return end - -- 3. 函数的参数 + -- 3. 特殊变量 + if source[1] == '_ENV' + or source[1] == 'self' then + return + end + -- 4. 函数的参数 if loc.parent and loc.parent.type == 'funcargs' then results[#results+1] = { start = source.start, @@ -78,11 +83,6 @@ Care['getlocal'] = function (source, results) } return end - -- 4. 特殊变量 - if source[1] == '_ENV' - or source[1] == 'self' then - return - end -- 5. const 变量 if loc.attrs then for _, attr in ipairs(loc.attrs) do |