diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-01-10 21:11:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-01-10 21:11:16 +0800 |
commit | 72954de6b303866cbdbab25c0f4e8c00b9dfbe2b (patch) | |
tree | 94154650fb262e9453636445004b2fb3f69e3720 /script | |
parent | 5addb4269a201e8a33479dce236adf8a38a37391 (diff) | |
download | lua-language-server-72954de6b303866cbdbab25c0f4e8c00b9dfbe2b.zip |
update
Diffstat (limited to 'script')
-rw-r--r-- | script/core/semantic-tokens.lua | 14 | ||||
-rw-r--r-- | script/parser/guide.lua | 2 | ||||
-rw-r--r-- | script/parser/newparser.lua | 1 |
3 files changed, 11 insertions, 6 deletions
diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua index f4050acd..96a1a56c 100644 --- a/script/core/semantic-tokens.lua +++ b/script/core/semantic-tokens.lua @@ -104,6 +104,15 @@ local Care = util.switch() modifieres = define.TokenModifiers.declaration, } end + if source.attrs then + for _, attr in ipairs(source.attrs) do + results[#results+1] = { + start = attr.start, + finish = attr.finish, + type = define.TokenTypes.typeParameter, + } + end + end local loc = source.node or source -- 1. 值为函数的局部变量 | Local variable whose value is a function if loc.refs then @@ -220,11 +229,6 @@ local Care = util.switch() end end end - -- 7. 函数调用 | Function call - if source.parent.type == 'call' - and source.parent.node == source then - return - end local mod if source.type == 'local' then mod = define.TokenModifiers.declaration diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 9c7f057d..258d8cdc 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -96,7 +96,7 @@ local childMap = { ['repeat'] = {'#', 'filter'}, ['while'] = {'filter', '#'}, ['in'] = {'keys', 'exps', '#'}, - ['loop'] = {'loc', 'max', 'step', '#'}, + ['loop'] = {'loc', 'init', 'max', 'step', '#'}, ['if'] = {'#'}, ['ifblock'] = {'filter', '#'}, ['elseifblock'] = {'filter', '#'}, diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua index 37f79d4b..83bf9e86 100644 --- a/script/parser/newparser.lua +++ b/script/parser/newparser.lua @@ -2853,6 +2853,7 @@ local function parseLocal() name.value = func name.vstart = func.start name.range = func.finish + name.locPos = locPos func.parent = name pushActionIntoCurrentChunk(name) return name |