diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-10-11 11:16:27 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-10-11 11:16:27 +0800 |
commit | 8cdff13ef2cd6d5529821134997c517c3494a568 (patch) | |
tree | aa567d128856c4ea616197b2b1a7420967336837 | |
parent | 8f24287d7f1190a5fff5f85de3f403d84bebf79c (diff) | |
download | lua-language-server-8cdff13ef2cd6d5529821134997c517c3494a568.zip |
fix #713 `runtime.special` broken
-rw-r--r-- | changelog.md | 3 | ||||
-rw-r--r-- | script/parser/newparser.lua | 2 | ||||
-rw-r--r-- | test/crossfile/completion.lua | 13 |
3 files changed, 17 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md index 533dd3df..1a6ecd97 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +## 2.4.3 +* `FIX` [#713](https://github.com/sumneko/lua-language-server/issues/713) + ## 2.4.2 `2021-10-8` * `FIX` [#702](https://github.com/sumneko/lua-language-server/issues/702) diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua index 001650fd..c49d2291 100644 --- a/script/parser/newparser.lua +++ b/script/parser/newparser.lua @@ -1956,7 +1956,7 @@ local function resolveName(node) else local ospeicals = State.options.special if ospeicals and ospeicals[name] then - addSpecial(name, node) + addSpecial(ospeicals[name], node) end end return node diff --git a/test/crossfile/completion.lua b/test/crossfile/completion.lua index ae843d3b..455f0600 100644 --- a/test/crossfile/completion.lua +++ b/test/crossfile/completion.lua @@ -850,3 +850,16 @@ TEST { }, completion = EXISTS } + +config.prop('Lua.runtime.special', 'import', 'require') +TEST { + { path = 'abcde.lua', content = '' }, + { + path = 'main.lua', + main = true, + content = [[ + import 'ab<??>' + ]] + }, + completion = EXISTS +} |