Skip to content

Commit 3278c8c

Browse files
committed
improve code-lens
1 parent 1806600 commit 3278c8c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

script/proto/proto.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ local function logRecieve(proto)
2323
log.info('rpc recieve:', json.encode(proto))
2424
end
2525

26+
---@class proto
2627
local m = {}
2728

2829
m.ability = {}
@@ -181,7 +182,7 @@ function m.doMethod(proto)
181182
m.responseErr(proto.id, proto._closeReason or define.ErrorCodes.InternalError, proto._closeMessage or res)
182183
end
183184
end
184-
ok, res = xpcall(abil, log.error, proto.params)
185+
ok, res = xpcall(abil, log.error, proto.params, proto.id)
185186
await.delay()
186187
end)
187188
end

script/provider/provider.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ m.register 'textDocument/codeLens' {
924924
resolveProvider = true,
925925
}
926926
},
927+
abortByFileUpdate = true,
927928
---@async
928929
function (params)
929930
local uri = files.getRealUri(params.textDocument.uri)
@@ -959,7 +960,7 @@ m.register 'codeLens/resolve' {
959960
function (codeLen)
960961
local core = require 'core.code-lens'
961962
local command = core.resolve(codeLen.data.uri, codeLen.data.id)
962-
codeLen.command = command
963+
codeLen.command = command or converter.command('...', '', {})
963964
return codeLen
964965
end
965966
}

0 commit comments

Comments
 (0)