diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-18 10:07:43 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-18 10:07:43 +0800 |
commit | de4cec30d4befc0de4bd264c16c52c1a575cd5d3 (patch) | |
tree | f02adc55fc4a6b007dba2b59e218bc3c6c69e8b8 /server | |
parent | 53addf4379d9fc9d5ff23a8888022c4dcc6883f5 (diff) | |
download | lua-language-server-de4cec30d4befc0de4bd264c16c52c1a575cd5d3.zip |
修正 # 的自动完成失效的问题
Diffstat (limited to 'server')
-rw-r--r-- | server/src/core/completion.lua | 4 | ||||
-rw-r--r-- | server/test/completion/init.lua | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua index 1fd0516f..d02897c7 100644 --- a/server/src/core/completion.lua +++ b/server/src/core/completion.lua @@ -487,9 +487,9 @@ local function searchSpecial(vm, source, word, callback, pos) local label = table.concat(chars) .. '+1' callback(label, nil, CompletionItemKind.Snippet, { textEdit = { - start = index.start, + start = inside.start + 1, finish = index.finish, - newText = ('[#%s] = '):format(label), + newText = ('%s] = '):format(label), }, }) end diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua index 5b3cf678..59189921 100644 --- a/server/test/completion/init.lua +++ b/server/test/completion/init.lua @@ -528,9 +528,9 @@ self.results.list[#@] label = 'self.results.list+1', kind = CompletionItemKind.Snippet, textEdit = { - start = 18, + start = 20, finish = 21, - newText = '[#self.results.list+1] = ', + newText = 'self.results.list+1] = ', }, }, } @@ -543,9 +543,9 @@ self.results.list[#self.re@] label = 'self.results.list+1', kind = CompletionItemKind.Snippet, textEdit = { - start = 18, + start = 20, finish = 28, - newText = '[#self.results.list+1] = ', + newText = 'self.results.list+1] = ', }, }, { @@ -562,9 +562,9 @@ fff[#ff@] label = 'fff+1', kind = CompletionItemKind.Snippet, textEdit = { - start = 4, + start = 6, finish = 9, - newText = '[#fff+1] = ', + newText = 'fff+1] = ', }, }, { |