diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-04-30 14:43:16 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-04-30 14:43:16 +0800 |
commit | 69a3ce64e5032f036d054ae435a8c523996567ed (patch) | |
tree | 34a603c3974fc5b8874ad2f9dc59768e4bc2f574 | |
parent | df40bf8e2c77ad38a0b98b95541f86656b2d8f0f (diff) | |
download | lua-language-server-69a3ce64e5032f036d054ae435a8c523996567ed.zip |
resolve #514
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/config.lua | 1 | ||||
-rw-r--r-- | script/core/completion.lua | 3 |
3 files changed, 5 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md index 25ec001f..a4e2da3a 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## 1.20.5 `CHG` folding: supports `-- #region` +`CHG` completion: `auto require` can be disabled `FIX` [#522](https://github.com/sumneko/lua-language-server/issues/522) `FIX` [#523](https://github.com/sumneko/lua-language-server/issues/523) diff --git a/script/config.lua b/script/config.lua index 7991e1ad..a133cf1c 100644 --- a/script/config.lua +++ b/script/config.lua @@ -164,6 +164,7 @@ local ConfigTemplate = { keywordSnippet = {'Replace', String}, displayContext = {6, Integer}, workspaceWord = {true, Boolean}, + autoRequire = {true, Boolean}, }, signatureHelp = { enable = {true, Boolean}, diff --git a/script/core/completion.lua b/script/core/completion.lua index 59bba005..6ee4d61d 100644 --- a/script/core/completion.lua +++ b/script/core/completion.lua @@ -292,6 +292,9 @@ local function checkLocal(ast, word, offset, results) end local function checkModule(ast, word, offset, results) + if not config.config.completion.autoRequire then + return + end local locals = guide.getVisibleLocals(ast.ast, offset) for uri in files.eachFile() do if files.eq(uri, guide.getUri(ast.ast)) then |