summaryrefslogtreecommitdiff
path: root/server/src/service.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/service.lua')
-rw-r--r--server/src/service.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/src/service.lua b/server/src/service.lua
index f2007bda..ab33b8e2 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -1,6 +1,5 @@
local subprocess = require 'bee.subprocess'
local method = require 'method'
-local fs = require 'bee.filesystem'
local thread = require 'thread'
local json = require 'json'
local parser = require 'parser'
@@ -96,17 +95,17 @@ function mt:_doDiagnostic()
self._needDiagnostics[uri] = nil
end
for uri, data in pairs(copy) do
- local ast = data.ast
- local results = data.results
- local suc, res = xpcall(matcher.diagnostics, log.error, ast, results)
- if suc then
+ local method = 'textDocument/publishDiagnostics'
+ local res = self:_callMethod(method, data)
+ if res then
self:_send {
- method = 'textDocument/publishDiagnostics',
+ method = method,
params = {
uri = uri,
diagnostics = res,
},
}
+ log.debug('publishDiagnostics', uri)
end
end
local passed = os.clock() - clock
@@ -210,6 +209,7 @@ function mt:compileText(uri)
self._needDiagnostics[uri] = {
ast = ast,
results = obj.results,
+ lines = obj.lines,
}
return obj