diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-01-30 15:44:02 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-01-30 15:44:02 +0800 |
commit | b4ac3e62ed182b5706e172323cd81cf11275818b (patch) | |
tree | 654e3daaed4de2133d1704d236d278a5e8913df4 /server/test/completion | |
parent | f6b8e5bd250b3deae6927d411b4546c715521044 (diff) | |
download | lua-language-server-b4ac3e62ed182b5706e172323cd81cf11275818b.zip |
修改'#'的自动完成行为
Diffstat (limited to 'server/test/completion')
-rw-r--r-- | server/test/completion/init.lua | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua index 2838e8ba..a2452eb1 100644 --- a/server/test/completion/init.lua +++ b/server/test/completion/init.lua @@ -61,7 +61,7 @@ local function findStartPos(pos, buf) local res = nil for i = pos-1, 1, -1 do local c = buf:sub(i, i) - if c:find '%a' then + if c:find '[%w_]' then res = i else break @@ -452,14 +452,33 @@ self.results.list[#@] label = 'self.results.list+1', kind = CompletionItemKind.Snippet, textEdit = { - start = 20, + start = 18, finish = 21, - newText = 'self.results.list+1] = ', + newText = '[#self.results.list+1] = ', }, }, } TEST [[ +self.results.list[#self.re@] +]] +{ + { + label = 'self.results.list+1', + kind = CompletionItemKind.Snippet, + textEdit = { + start = 18, + finish = 28, + newText = '[#self.results.list+1] = ', + }, + }, + { + label = 'results', + kind = CompletionItemKind.Field, + }, +} + +TEST [[ fff[#ff@] ]] { @@ -467,9 +486,9 @@ fff[#ff@] label = 'fff+1', kind = CompletionItemKind.Snippet, textEdit = { - start = 6, + start = 4, finish = 9, - newText = 'fff+1] = ', + newText = '[#fff+1] = ', }, }, { |