diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-01-05 09:45:56 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-01-05 09:45:56 +0800 |
commit | 3aae6e212553a6de78f45783b48ce21053a3a67e (patch) | |
tree | c4caf5d36b9f9f4d44a848b9c2025d3b41707f68 | |
parent | e022ec0124382af1fb1dfa05ceba1e18989f5dc5 (diff) | |
download | lua-language-server-3aae6e212553a6de78f45783b48ce21053a3a67e.zip |
fix
-rw-r--r-- | changelog.md | 3 | ||||
-rw-r--r-- | script/core/completion.lua | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/changelog.md b/changelog.md index f7f698b4..8f5a3bdf 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +## 1.11.0 +* `FIX` runtime errors + ## 1.10.0 `2021-1-4` * `NEW` workspace: supports `.dll`(`.so`) in `require` diff --git a/script/core/completion.lua b/script/core/completion.lua index 140bee5c..93ba6300 100644 --- a/script/core/completion.lua +++ b/script/core/completion.lua @@ -593,7 +593,7 @@ local function checkTableField(ast, word, start, results) end local function checkCommon(ast, word, text, offset, results) - local myUri = ast.uri + local myUri = ast and ast.uri local used = {} for _, result in ipairs(results) do used[result.label] = true @@ -617,7 +617,7 @@ local function checkCommon(ast, word, text, offset, results) for _, str in ipairs(cache.commonWords) do if #str >= 3 and not used[str] - and (str ~= word or not files.eq(myUri, uri)) then + and (str ~= word or (myUri and not files.eq(myUri, uri))) then used[str] = true if matchKey(word, str) then results[#results+1] = { |