Skip to content

Commit 5b5ffd7

Browse files
committed
fix diagnostic refresh
syntax errors dose not refresh after reload workspace by change config or `Lua.runtime.XXX`
1 parent 12ca56a commit 5b5ffd7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

script/files.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ end
283283

284284
function m.resetText(uri)
285285
local file = m.fileMap[uri]
286+
if not file then
287+
return
288+
end
286289
local originText = file.originText
287290
file.originText = nil
288291
m.setText(uri, originText, file.trusted)

script/workspace/workspace.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,9 @@ config.watch(function (uri, key, value, oldValue)
558558
or key:find '^Lua.type'
559559
or key:find '^files' then
560560
if value ~= oldValue then
561-
m.reload(scope.getScope(uri))
561+
local scp = scope.getScope(uri)
562+
m.reload(scp)
563+
m.resetFiles(scp)
562564
end
563565
end
564566
end)

0 commit comments

Comments
 (0)