diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-24 18:19:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-24 18:19:30 +0800 |
commit | b7782be38cb8f9d3f94b615976cdfed00e4c183f (patch) | |
tree | 34a963d3aa899e297702ed08de06a8a3eca20acf /server/src/method | |
parent | f8390c046278c3b34076d4e250e247a66ecae923 (diff) | |
download | lua-language-server-b7782be38cb8f9d3f94b615976cdfed00e4c183f.zip |
提示require的候选目标
Diffstat (limited to 'server/src/method')
-rw-r--r-- | server/src/method/initialize.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/server/src/method/initialize.lua b/server/src/method/initialize.lua index 4bc3ff2e..3de9a89e 100644 --- a/server/src/method/initialize.lua +++ b/server/src/method/initialize.lua @@ -1,3 +1,12 @@ +local function allWords() + local str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' + local list = {} + for c in str:gmatch '.' do + list[#list+1] = c + end + return table.unpack(list) +end + return function (lsp) lsp._inited = true return { @@ -26,7 +35,7 @@ return function (lsp) -- 自动完成 completionProvider = { resolveProvider = false, - triggerCharacters = { '.', ':' }, + triggerCharacters = { '.', ':', allWords() }, }, -- 工作目录 workspace = { |