diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-04-06 14:46:55 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-04-06 14:46:55 +0800 |
commit | 73b5e9eb4d6eb08792b36c9a6b89e9fc69497d7c (patch) | |
tree | 63f0a139f0b03ae6b9b119c914c1b5b87a7db3e8 | |
parent | a0caef2adf7ad48c83d5300b486e0937d6890799 (diff) | |
download | lua-language-server-73b5e9eb4d6eb08792b36c9a6b89e9fc69497d7c.zip |
fix #487
-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 |