@@ -25,12 +25,12 @@ describe("client", function()
25
25
server_capabilities = {},
26
26
}
27
27
setmetatable (mock_client , vim .lsp .client )
28
- lsp .start_client .returns (mock_client_id )
28
+ lsp .start .returns (mock_client_id )
29
29
sources .get_filetypes .returns (mock_filetypes )
30
30
end )
31
31
32
32
after_each (function ()
33
- lsp .start_client :clear ()
33
+ lsp .start :clear ()
34
34
lsp .buf_attach_client :clear ()
35
35
36
36
c .reset ()
@@ -44,7 +44,7 @@ describe("client", function()
44
44
local id = client .start_client (" mock-root" )
45
45
46
46
assert .equals (id , mock_client_id )
47
- local opts = lsp .start_client .calls [1 ].refs [1 ]
47
+ local opts = lsp .start .calls [1 ].refs [1 ]
48
48
assert .equals (opts .name , " null-ls" )
49
49
assert .equals (opts .root_dir , " mock-root" )
50
50
assert .equals (opts .cmd , require (" null-ls.rpc" ).start )
@@ -60,7 +60,7 @@ describe("client", function()
60
60
c ._set ({ on_init = on_init })
61
61
62
62
client .start_client (" mock-file" )
63
- lsp .start_client .calls [1 ].refs [1 ].on_init (mock_client , mock_initialize_result )
63
+ lsp .start .calls [1 ].refs [1 ].on_init (mock_client , mock_initialize_result )
64
64
65
65
assert .stub (on_init ).was_called_with (mock_client , mock_initialize_result )
66
66
end )
@@ -69,9 +69,9 @@ describe("client", function()
69
69
local on_exit
70
70
before_each (function ()
71
71
client .start_client ()
72
- lsp .start_client .calls [1 ].refs [1 ].on_init (mock_client )
72
+ lsp .start .calls [1 ].refs [1 ].on_init (mock_client )
73
73
74
- on_exit = lsp .start_client .calls [1 ].refs [1 ].on_exit
74
+ on_exit = lsp .start .calls [1 ].refs [1 ].on_exit
75
75
end )
76
76
77
77
it (" should clear client and id" , function ()
@@ -95,7 +95,7 @@ describe("client", function()
95
95
local on_init
96
96
before_each (function ()
97
97
client .start_client ()
98
- on_init = lsp .start_client .calls [1 ].refs [1 ].on_init
98
+ on_init = lsp .start .calls [1 ].refs [1 ].on_init
99
99
end )
100
100
101
101
it (" should set client and override client.supports_method" , function ()
@@ -163,7 +163,7 @@ describe("client", function()
163
163
164
164
it (" should clear client and id on exit" , function ()
165
165
client .start_client ()
166
- local opts = lsp .start_client .calls [1 ].refs [1 ]
166
+ local opts = lsp .start .calls [1 ].refs [1 ]
167
167
opts .on_init (mock_client )
168
168
169
169
opts .on_exit ()
@@ -218,7 +218,7 @@ describe("client", function()
218
218
c ._set ({ root_dir = root_dir })
219
219
220
220
client .try_add (mock_bufnr , function ()
221
- local opts = lsp .start_client .calls [1 ].refs [1 ]
221
+ local opts = lsp .start .calls [1 ].refs [1 ]
222
222
assert .equals (opts .root_dir , vim .uv .cwd ())
223
223
end )
224
224
end )
@@ -229,7 +229,7 @@ describe("client", function()
229
229
c ._set ({ root_dir = root_dir })
230
230
231
231
client .try_add (mock_bufnr , function ()
232
- local opts = lsp .start_client .calls [1 ].refs [1 ]
232
+ local opts = lsp .start .calls [1 ].refs [1 ]
233
233
assert .equals (opts .root_dir , " mock-root" )
234
234
end )
235
235
end )
@@ -254,7 +254,7 @@ describe("client", function()
254
254
end )
255
255
256
256
coroutine.yield ()
257
- local opts = lsp .start_client .calls [1 ].refs [1 ]
257
+ local opts = lsp .start .calls [1 ].refs [1 ]
258
258
assert .equals (opts .root_dir , " mock-root" )
259
259
end )
260
260
@@ -328,7 +328,7 @@ describe("client", function()
328
328
329
329
it (" should call on_attach with client and bufnr if client" , function ()
330
330
client .start_client ()
331
- lsp .start_client .calls [1 ].refs [1 ].on_init (mock_client )
331
+ lsp .start .calls [1 ].refs [1 ].on_init (mock_client )
332
332
333
333
client .setup_buffer (mock_bufnr )
334
334
@@ -344,7 +344,7 @@ describe("client", function()
344
344
local on_init
345
345
before_each (function ()
346
346
client .start_client ()
347
- on_init = lsp .start_client .calls [1 ].refs [1 ].on_init
347
+ on_init = lsp .start .calls [1 ].refs [1 ].on_init
348
348
end )
349
349
350
350
it (" should do nothing if no client" , function ()
@@ -375,7 +375,7 @@ describe("client", function()
375
375
local on_init
376
376
before_each (function ()
377
377
client .start_client ()
378
- on_init = lsp .start_client .calls [1 ].refs [1 ].on_init
378
+ on_init = lsp .start .calls [1 ].refs [1 ].on_init
379
379
end )
380
380
381
381
it (" should return client handler if defined" , function ()
@@ -400,7 +400,7 @@ describe("client", function()
400
400
describe (" update_filetypes" , function ()
401
401
before_each (function ()
402
402
client .start_client ()
403
- lsp .start_client .calls [1 ].refs [1 ].on_init (mock_client )
403
+ lsp .start .calls [1 ].refs [1 ].on_init (mock_client )
404
404
end )
405
405
406
406
it (" should update client filetypes" , function ()
0 commit comments