summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-09 18:57:57 +0800
committersumneko <sumneko@hotmail.com>2019-04-09 18:57:57 +0800
commit70441948891e7d9d5c2cde9bb81b095b529e4d72 (patch)
tree6a8eb42e6b9d02fb14142f538c75eee3737dd803 /server
parent62b4089bb90d06dfdfe54bea33b8c9c8baaf01f9 (diff)
downloadlua-language-server-70441948891e7d9d5c2cde9bb81b095b529e4d72.zip
修正有时编译完后没有诊断的bug
Diffstat (limited to 'server')
-rw-r--r--server/src/service.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/service.lua b/server/src/service.lua
index 5b7465d3..88c42fda 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -352,8 +352,9 @@ end
function mt:compileAst(obj)
local ast, err = parser:ast(obj.text, 'lua', config.config.runtime.version)
- obj.astErr = err
- if not ast then
+ if ast then
+ obj.astErr = err
+ else
if type(err) == 'string' then
local message = lang.script('PARSER_CRASH', err)
log.debug(message)
@@ -450,6 +451,7 @@ function mt:compileVM(uri)
end
if self._needCompile[uri] then
self:_markCompiled(uri, compiled)
+ self._needDiagnostics[uri] = true
else
if vm then
vm:remove()