summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lsp.lua3
-rw-r--r--src/method/textDocument/definition.lua2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/lsp.lua b/src/lsp.lua
index 0f84671b..6c801a33 100644
--- a/src/lsp.lua
+++ b/src/lsp.lua
@@ -59,7 +59,10 @@ function mt:_readAsContent(header)
local id = res.id
local method = res.method
local params = res.params
+ log.debug(('执行任务[%s],ID[%s]'):format(method, id))
+ local clock = os.clock()
local response, err = self:_callback(method, params)
+ log.debug(('任务[%s]执行完毕,耗时[%.3f]秒,ID[%s]'):format(method, os.clock() - clock, id))
if response then
self:_send {
id = id,
diff --git a/src/method/textDocument/definition.lua b/src/method/textDocument/definition.lua
index 392696d1..d9378b58 100644
--- a/src/method/textDocument/definition.lua
+++ b/src/method/textDocument/definition.lua
@@ -11,7 +11,7 @@ return function (lsp, params)
local pos = parser.calcline.position(text, params.position.line + 1, params.position.character + 1)
local suc, start, finish = matcher.definition(text, pos)
if not suc then
- return nil, start
+ return {}
end
local start_row, start_col = parser.calcline.rowcol(text, start)