diff options
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/method/textDocument/didClose.lua | 2 | ||||
-rw-r--r-- | server/src/service.lua | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/server/src/method/textDocument/didClose.lua b/server/src/method/textDocument/didClose.lua index 5da33010..7d097407 100644 --- a/server/src/method/textDocument/didClose.lua +++ b/server/src/method/textDocument/didClose.lua @@ -1,6 +1,6 @@ return function (lsp, params) local doc = params.textDocument - --lsp:removeText(doc.uri, doc.version) + lsp:removeText(doc.uri, doc.version) lsp:close(doc.uri) return true end diff --git a/server/src/service.lua b/server/src/service.lua index 528bc644..376fd2c3 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -237,6 +237,15 @@ function mt:readText(uri, path) self:needCompile(uri) end +function mt:removeText(uri) + local obj = self._file[uri] + if obj then + return + end + obj.version = -1 + self:clearDiagnostics(uri) +end + function mt:open(uri) self._opening[uri] = true end @@ -403,10 +412,6 @@ function mt:compileChain(child, parent) childObj.parent[parent] = true end -function mt:removeText(uri) - self._file[uri] = nil -end - function mt:checkWorkSpaceComplete() if self._hasCheckedWorkSpaceComplete then return |