@@ -37,22 +37,22 @@ describe("LanguageClientConnection", () => {
37
37
await lc . initialize ( params )
38
38
39
39
expect ( lc . _sendRequest . called ) . equals ( true )
40
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "initialize" )
40
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "initialize" )
41
41
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
42
42
} )
43
43
44
44
it ( "sends a request for shutdown" , async ( ) => {
45
45
await lc . shutdown ( )
46
46
47
47
expect ( lc . _sendRequest . called ) . equals ( true )
48
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "shutdown" )
48
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "shutdown" )
49
49
} )
50
50
51
51
it ( "sends a request for completion" , async ( ) => {
52
52
await lc . completion ( textDocumentPositionParams )
53
53
54
54
expect ( lc . _sendRequest . called ) . equals ( true )
55
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/completion" )
55
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/completion" )
56
56
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( textDocumentPositionParams )
57
57
} )
58
58
@@ -61,55 +61,55 @@ describe("LanguageClientConnection", () => {
61
61
await lc . completionItemResolve ( completionItem )
62
62
63
63
expect ( lc . _sendRequest . called ) . equals ( true )
64
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "completionItem/resolve" )
64
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "completionItem/resolve" )
65
65
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( completionItem )
66
66
} )
67
67
68
68
it ( "sends a request for hover" , async ( ) => {
69
69
await lc . hover ( textDocumentPositionParams )
70
70
71
71
expect ( lc . _sendRequest . called ) . equals ( true )
72
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/hover" )
72
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/hover" )
73
73
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( textDocumentPositionParams )
74
74
} )
75
75
76
76
it ( "sends a request for signatureHelp" , async ( ) => {
77
77
await lc . signatureHelp ( textDocumentPositionParams )
78
78
79
79
expect ( lc . _sendRequest . called ) . equals ( true )
80
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/signatureHelp" )
80
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/signatureHelp" )
81
81
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( textDocumentPositionParams )
82
82
} )
83
83
84
84
it ( "sends a request for gotoDefinition" , async ( ) => {
85
85
await lc . gotoDefinition ( textDocumentPositionParams )
86
86
87
87
expect ( lc . _sendRequest . called ) . equals ( true )
88
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/definition" )
88
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/definition" )
89
89
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( textDocumentPositionParams )
90
90
} )
91
91
92
92
it ( "sends a request for findReferences" , async ( ) => {
93
93
await lc . findReferences ( textDocumentPositionParams )
94
94
95
95
expect ( lc . _sendRequest . called ) . equals ( true )
96
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/references" )
96
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/references" )
97
97
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( textDocumentPositionParams )
98
98
} )
99
99
100
100
it ( "sends a request for documentHighlight" , async ( ) => {
101
101
await lc . documentHighlight ( textDocumentPositionParams )
102
102
103
103
expect ( lc . _sendRequest . called ) . equals ( true )
104
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/documentHighlight" )
104
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/documentHighlight" )
105
105
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( textDocumentPositionParams )
106
106
} )
107
107
108
108
it ( "sends a request for documentSymbol" , async ( ) => {
109
109
await lc . documentSymbol ( textDocumentPositionParams )
110
110
111
111
expect ( lc . _sendRequest . called ) . equals ( true )
112
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/documentSymbol" )
112
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/documentSymbol" )
113
113
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( textDocumentPositionParams )
114
114
} )
115
115
@@ -118,7 +118,7 @@ describe("LanguageClientConnection", () => {
118
118
await lc . workspaceSymbol ( params )
119
119
120
120
expect ( lc . _sendRequest . called ) . equals ( true )
121
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "workspace/symbol" )
121
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "workspace/symbol" )
122
122
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
123
123
} )
124
124
@@ -134,7 +134,7 @@ describe("LanguageClientConnection", () => {
134
134
await lc . codeAction ( params )
135
135
136
136
expect ( lc . _sendRequest . called ) . equals ( true )
137
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/codeAction" )
137
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/codeAction" )
138
138
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
139
139
} )
140
140
@@ -145,7 +145,7 @@ describe("LanguageClientConnection", () => {
145
145
await lc . codeLens ( params )
146
146
147
147
expect ( lc . _sendRequest . called ) . equals ( true )
148
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/codeLens" )
148
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/codeLens" )
149
149
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
150
150
} )
151
151
@@ -159,7 +159,7 @@ describe("LanguageClientConnection", () => {
159
159
await lc . codeLensResolve ( params )
160
160
161
161
expect ( lc . _sendRequest . called ) . equals ( true )
162
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "codeLens/resolve" )
162
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "codeLens/resolve" )
163
163
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
164
164
} )
165
165
@@ -170,7 +170,7 @@ describe("LanguageClientConnection", () => {
170
170
await lc . documentLink ( params )
171
171
172
172
expect ( lc . _sendRequest . called ) . equals ( true )
173
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/documentLink" )
173
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/documentLink" )
174
174
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
175
175
} )
176
176
@@ -185,7 +185,7 @@ describe("LanguageClientConnection", () => {
185
185
await lc . documentLinkResolve ( params )
186
186
187
187
expect ( lc . _sendRequest . called ) . equals ( true )
188
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "documentLink/resolve" )
188
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "documentLink/resolve" )
189
189
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
190
190
} )
191
191
@@ -197,7 +197,7 @@ describe("LanguageClientConnection", () => {
197
197
await lc . documentFormatting ( params )
198
198
199
199
expect ( lc . _sendRequest . called ) . equals ( true )
200
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/formatting" )
200
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/formatting" )
201
201
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
202
202
} )
203
203
@@ -213,7 +213,7 @@ describe("LanguageClientConnection", () => {
213
213
await lc . documentRangeFormatting ( params )
214
214
215
215
expect ( lc . _sendRequest . called ) . equals ( true )
216
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/rangeFormatting" )
216
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/rangeFormatting" )
217
217
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
218
218
} )
219
219
@@ -227,7 +227,7 @@ describe("LanguageClientConnection", () => {
227
227
await lc . documentOnTypeFormatting ( params )
228
228
229
229
expect ( lc . _sendRequest . called ) . equals ( true )
230
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/onTypeFormatting" )
230
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/onTypeFormatting" )
231
231
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
232
232
} )
233
233
@@ -240,7 +240,7 @@ describe("LanguageClientConnection", () => {
240
240
await lc . rename ( params )
241
241
242
242
expect ( lc . _sendRequest . called ) . equals ( true )
243
- expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/rename" )
243
+ expect ( lc . _sendRequest . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/rename" )
244
244
expect ( lc . _sendRequest . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
245
245
} )
246
246
} )
@@ -268,15 +268,15 @@ describe("LanguageClientConnection", () => {
268
268
lc . exit ( )
269
269
270
270
expect ( lc . _sendNotification . called ) . equals ( true )
271
- expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] ) . equals ( "exit" )
271
+ expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "exit" )
272
272
expect ( lc . _sendNotification . getCall ( 0 ) . args . length ) . equals ( 1 )
273
273
} )
274
274
275
275
it ( "initialized sends notification" , ( ) => {
276
276
lc . initialized ( )
277
277
278
278
expect ( lc . _sendNotification . called ) . equals ( true )
279
- expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] ) . equals ( "initialized" )
279
+ expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "initialized" )
280
280
const expected : ls . InitializedParams = { }
281
281
expect ( lc . _sendNotification . getCall ( 0 ) . args [ 1 ] ) . to . deep . equal ( expected )
282
282
} )
@@ -288,7 +288,7 @@ describe("LanguageClientConnection", () => {
288
288
lc . didChangeConfiguration ( params )
289
289
290
290
expect ( lc . _sendNotification . called ) . equals ( true )
291
- expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] ) . equals ( "workspace/didChangeConfiguration" )
291
+ expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "workspace/didChangeConfiguration" )
292
292
expect ( lc . _sendNotification . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
293
293
} )
294
294
@@ -299,7 +299,7 @@ describe("LanguageClientConnection", () => {
299
299
lc . didOpenTextDocument ( params )
300
300
301
301
expect ( lc . _sendNotification . called ) . equals ( true )
302
- expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/didOpen" )
302
+ expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/didOpen" )
303
303
expect ( lc . _sendNotification . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
304
304
} )
305
305
@@ -311,7 +311,7 @@ describe("LanguageClientConnection", () => {
311
311
lc . didChangeTextDocument ( params )
312
312
313
313
expect ( lc . _sendNotification . called ) . equals ( true )
314
- expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/didChange" )
314
+ expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/didChange" )
315
315
expect ( lc . _sendNotification . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
316
316
} )
317
317
@@ -322,7 +322,7 @@ describe("LanguageClientConnection", () => {
322
322
lc . didCloseTextDocument ( params )
323
323
324
324
expect ( lc . _sendNotification . called ) . equals ( true )
325
- expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/didClose" )
325
+ expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/didClose" )
326
326
expect ( lc . _sendNotification . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
327
327
} )
328
328
@@ -333,7 +333,7 @@ describe("LanguageClientConnection", () => {
333
333
lc . didSaveTextDocument ( params )
334
334
335
335
expect ( lc . _sendNotification . called ) . equals ( true )
336
- expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] ) . equals ( "textDocument/didSave" )
336
+ expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "textDocument/didSave" )
337
337
expect ( lc . _sendNotification . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
338
338
} )
339
339
@@ -342,7 +342,7 @@ describe("LanguageClientConnection", () => {
342
342
lc . didChangeWatchedFiles ( params )
343
343
344
344
expect ( lc . _sendNotification . called ) . equals ( true )
345
- expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] ) . equals ( "workspace/didChangeWatchedFiles" )
345
+ expect ( lc . _sendNotification . getCall ( 0 ) . args [ 0 ] . method ) . equals ( "workspace/didChangeWatchedFiles" )
346
346
expect ( lc . _sendNotification . getCall ( 0 ) . args [ 1 ] ) . equals ( params )
347
347
} )
348
348
} )
0 commit comments