summaryrefslogtreecommitdiff
path: root/server/src/service.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-11 16:27:03 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-11 16:27:03 +0800
commit5b6a3da07d96345073a275e5e298d83ab3b5ead9 (patch)
treedb995ed3369a250b458e1b2cd9c7bb0fd4c3752d /server/src/service.lua
parentc89e12dc4282c942ea91edbdb7bcab0657fb1ad6 (diff)
downloadlua-language-server-5b6a3da07d96345073a275e5e298d83ab3b5ead9.zip
转到定义可以用了
Diffstat (limited to 'server/src/service.lua')
-rw-r--r--server/src/service.lua19
1 files changed, 10 insertions, 9 deletions
diff --git a/server/src/service.lua b/server/src/service.lua
index 6e753b39..1513126b 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -186,7 +186,7 @@ function mt:loadText(uri)
return nil
end
self:compileText(uri)
- return obj.results, obj.lines
+ return obj.vm, obj.lines
end
function mt:compileText(uri)
@@ -198,18 +198,19 @@ function mt:compileText(uri)
return nil
end
self._needCompile[uri] = nil
- local ast = parser:ast(obj.text)
+ local ast = parser:ast(obj.text)
+
obj.vm = matcher.vm(ast)
- if not obj.vm then
+ obj.lines = parser:lines(obj.text, 'utf8')
+ if obj.vm then
return obj
end
- obj.lines = parser:lines(obj.text, 'utf8')
self._needDiagnostics[uri] = {
- ast = ast,
- vm = obj.vm,
- lines = obj.lines,
- uri = uri,
+ ast = ast,
+ vm = obj.vm,
+ lines = obj.lines,
+ uri = uri,
}
return obj
@@ -226,7 +227,7 @@ function mt:on_tick()
self:_doProto(proto)
end
self:_buildTextCache()
- self:_doDiagnostic()
+ --self:_doDiagnostic()
end
function mt:listen()