diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-01-13 20:13:57 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-01-13 20:13:57 +0800 |
commit | 604d6a6aad7eaa173a4fb9d7dd49b8ac2f6976d9 (patch) | |
tree | 60392ca227e6a7c9db10ae77835fffabfb53d960 /script | |
parent | 13213502dc06cfa709ff838f3d93516624191471 (diff) | |
download | lua-language-server-604d6a6aad7eaa173a4fb9d7dd49b8ac2f6976d9.zip |
some fix
Diffstat (limited to 'script')
-rw-r--r-- | script/provider/diagnostic.lua | 4 | ||||
-rw-r--r-- | script/workspace/scope.lua | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 907ed55d..3152c332 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -350,7 +350,7 @@ function m.diagnosticsScope(uri, force) if not force and delay < 0 then return end - await.close ('diagnosticsScope:' .. uri) + await.close ('diagnosticsScope:' .. (uri or '<fallback>')) await.call(function () ---@async await.sleep(math.max(delay, 0.1)) local clock = os.clock() @@ -377,7 +377,7 @@ function m.diagnosticsScope(uri, force) end bar:remove() log.debug('全文诊断耗时:', os.clock() - clock) - end, 'files.version', ('diagnosticsScope:' .. uri)) + end, 'files.version', ('diagnosticsScope:' .. (uri or '<fallback>'))) end ws.watch(function (ev, uri) diff --git a/script/workspace/scope.lua b/script/workspace/scope.lua index fc71e60c..258f929c 100644 --- a/script/workspace/scope.lua +++ b/script/workspace/scope.lua @@ -25,6 +25,9 @@ end ---@param uri uri ---@return boolean function mt:isChildUri(uri) + if not uri then + return false + end if not self.uri then return true end @@ -34,6 +37,9 @@ end ---@param uri uri ---@return boolean function mt:isLinkedUri(uri) + if not uri then + return false + end for linkUri in pairs(self._links) do if uri:sub(1, #linkUri) == linkUri then return true |