summaryrefslogtreecommitdiff
path: root/server-beta/src/files.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-09-23 18:59:57 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-09-23 18:59:57 +0800
commit4e1937f19ed61d3e7163aa06e267f3e92489e321 (patch)
treeacbdea488c5ab38db080d2ff44360e4611f1dbbd /server-beta/src/files.lua
parent7e9154e64d2a743903b1f9400bd254a039816ca0 (diff)
downloadlua-language-server-4e1937f19ed61d3e7163aa06e267f3e92489e321.zip
修正一些报错
Diffstat (limited to 'server-beta/src/files.lua')
-rw-r--r--server-beta/src/files.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/server-beta/src/files.lua b/server-beta/src/files.lua
index 0d8bd526..15190630 100644
--- a/server-beta/src/files.lua
+++ b/server-beta/src/files.lua
@@ -41,9 +41,11 @@ function m.setText(uri, text)
pub.removeTask(file.compiling)
end
file.compiling = pub.syncTask('compile', text, function (ast)
- ast.uri = originUri
- file.ast = ast
file.compiling = nil
+ file.ast = ast
+ if ast then
+ ast.uri = originUri
+ end
local onCompiledList = file.onCompiledList
if onCompiledList then
file.onCompiledList = nil