summaryrefslogtreecommitdiff
path: root/script/proto
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-09-24 17:20:52 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-09-24 17:20:52 +0800
commite5a094cfc9ecaaea9873905b37658b9227c8fe99 (patch)
treed74fac0c3eea4c21e83aa8b0d395dbfb815a8047 /script/proto
parentf06d38754a38ef25bfe5a10b931b596becc092e4 (diff)
downloadlua-language-server-e5a094cfc9ecaaea9873905b37658b9227c8fe99.zip
supports `$/cancelRequest`
Diffstat (limited to 'script/proto')
-rw-r--r--script/proto/proto.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script/proto/proto.lua b/script/proto/proto.lua
index a0880011..61306b9f 100644
--- a/script/proto/proto.lua
+++ b/script/proto/proto.lua
@@ -4,7 +4,6 @@ local await = require 'await'
local pub = require 'pub'
local jsonrpc = require 'jsonrpc'
local define = require 'proto.define'
-local timer = require 'timer'
local json = require 'json'
local reqCounter = util.counter()
@@ -121,6 +120,9 @@ function m.doMethod(proto)
end
await.call(function ()
--log.debug('Start method:', method)
+ if proto.id then
+ await.setID('proto:' .. proto.id)
+ end
local clock = os.clock()
local ok = true
local res
@@ -134,6 +136,7 @@ function m.doMethod(proto)
if not proto.id then
return
end
+ await.close('proto:' .. proto.id)
if ok then
m.response(proto.id, res)
else