Skip to content

Commit 604d6a6

Browse files
committed
some fix
1 parent 1321350 commit 604d6a6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

script/provider/diagnostic.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function m.diagnosticsScope(uri, force)
350350
if not force and delay < 0 then
351351
return
352352
end
353-
await.close ('diagnosticsScope:' .. uri)
353+
await.close ('diagnosticsScope:' .. (uri or '<fallback>'))
354354
await.call(function () ---@async
355355
await.sleep(math.max(delay, 0.1))
356356
local clock = os.clock()
@@ -377,7 +377,7 @@ function m.diagnosticsScope(uri, force)
377377
end
378378
bar:remove()
379379
log.debug('全文诊断耗时:', os.clock() - clock)
380-
end, 'files.version', ('diagnosticsScope:' .. uri))
380+
end, 'files.version', ('diagnosticsScope:' .. (uri or '<fallback>')))
381381
end
382382

383383
ws.watch(function (ev, uri)

script/workspace/scope.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ end
2525
---@param uri uri
2626
---@return boolean
2727
function mt:isChildUri(uri)
28+
if not uri then
29+
return false
30+
end
2831
if not self.uri then
2932
return true
3033
end
@@ -34,6 +37,9 @@ end
3437
---@param uri uri
3538
---@return boolean
3639
function mt:isLinkedUri(uri)
40+
if not uri then
41+
return false
42+
end
3743
for linkUri in pairs(self._links) do
3844
if uri:sub(1, #linkUri) == linkUri then
3945
return true

0 commit comments

Comments
 (0)