@@ -49,6 +49,8 @@ function mt:start(callback)
4949 finished = true
5050 end )
5151
52+ local jumpedTime = 0
53+
5254 while true do
5355 if finished then
5456 break
@@ -64,6 +66,10 @@ function mt:start(callback)
6466 goto CONTINUE
6567 end
6668 timer .timeJump (1.0 )
69+ jumpedTime = jumpedTime + 1.0
70+ if jumpedTime > 2 * 60 * 60 then
71+ error (' two hours later ...' )
72+ end
6773 :: CONTINUE::
6874 end
6975
@@ -111,10 +117,14 @@ function mt:update()
111117 for _ , out in ipairs (outs ) do
112118 if out .method then
113119 local callback = self ._methods [out .method ]
114- proto .doResponse {
115- id = out .id ,
116- params = callback (out .params ),
117- }
120+ if callback then
121+ proto .doResponse {
122+ id = out .id ,
123+ params = callback (out .params ),
124+ }
125+ elseif out .method :sub (1 , 2 ) ~= ' $/' then
126+ error (' Unknown method: ' .. out .method )
127+ end
118128 else
119129 local callback = self ._waiting [out .id ]
120130 self ._waiting [out .id ] = nil
@@ -124,8 +134,19 @@ function mt:update()
124134 return true
125135end
126136
127- function mt :register (name , callback )
128- self ._methods [name ] = callback
137+ function mt :register (method , callback )
138+ self ._methods [method ] = callback
139+ end
140+
141+ function mt :registerFakers ()
142+ for _ , method in ipairs {
143+ ' workspace/configuration' ,
144+ ' textDocument/publishDiagnostics' ,
145+ } do
146+ self :register (method , function ()
147+ return nil
148+ end )
149+ end
129150end
130151
131152--- @return languageClient
0 commit comments