jaclang 0.0.6__py3-none-any.whl → 0.0.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of jaclang might be problematic. Click here for more details.

Files changed (82) hide show
  1. jaclang/__init__.py +2 -1
  2. jaclang/cli/__jac_gen__/__init__.py +0 -0
  3. jaclang/cli/__jac_gen__/cli.py +175 -0
  4. jaclang/cli/__jac_gen__/cmds.py +132 -0
  5. jaclang/cli/cmds.jac +3 -0
  6. jaclang/cli/impl/__jac_gen__/__init__.py +0 -0
  7. jaclang/cli/impl/__jac_gen__/cli_impl.py +16 -0
  8. jaclang/cli/impl/__jac_gen__/cmds_impl.py +26 -0
  9. jaclang/cli/impl/cmds_impl.jac +17 -3
  10. jaclang/core/__jac_gen__/__init__.py +0 -0
  11. jaclang/core/__jac_gen__/primitives.py +567 -0
  12. jaclang/core/impl/__jac_gen__/__init__.py +0 -0
  13. jaclang/core/impl/__jac_gen__/arch_impl.py +24 -0
  14. jaclang/core/impl/__jac_gen__/element_impl.py +26 -0
  15. jaclang/core/impl/__jac_gen__/exec_ctx_impl.py +12 -0
  16. jaclang/core/impl/__jac_gen__/memory_impl.py +14 -0
  17. jaclang/core/impl/element_impl.jac +2 -2
  18. jaclang/core/primitives.jac +1 -0
  19. jaclang/jac/absyntree.py +65 -42
  20. jaclang/jac/constant.py +4 -0
  21. jaclang/jac/importer.py +18 -60
  22. jaclang/jac/langserve.py +26 -0
  23. jaclang/jac/lexer.py +9 -1
  24. jaclang/jac/parser.py +135 -123
  25. jaclang/jac/passes/blue/ast_build_pass.py +410 -353
  26. jaclang/jac/passes/blue/blue_pygen_pass.py +15 -0
  27. jaclang/jac/passes/blue/decl_def_match_pass.py +33 -21
  28. jaclang/jac/passes/blue/import_pass.py +1 -1
  29. jaclang/jac/passes/blue/pyout_pass.py +47 -12
  30. jaclang/jac/passes/blue/sym_tab_build_pass.py +38 -127
  31. jaclang/jac/passes/blue/tests/test_ast_build_pass.py +2 -2
  32. jaclang/jac/passes/blue/tests/test_blue_pygen_pass.py +9 -30
  33. jaclang/jac/passes/blue/tests/test_decl_def_match_pass.py +13 -13
  34. jaclang/jac/passes/blue/tests/test_sym_tab_build_pass.py +6 -4
  35. jaclang/jac/passes/ir_pass.py +1 -1
  36. jaclang/jac/passes/purple/__jac_gen__/__init__.py +0 -0
  37. jaclang/jac/passes/purple/__jac_gen__/analyze_pass.py +37 -0
  38. jaclang/jac/passes/purple/__jac_gen__/purple_pygen_pass.py +305 -0
  39. jaclang/jac/passes/purple/impl/__jac_gen__/__init__.py +0 -0
  40. jaclang/jac/passes/purple/impl/__jac_gen__/purple_pygen_pass_impl.py +23 -0
  41. jaclang/jac/symtable.py +12 -4
  42. jaclang/jac/tests/fixtures/__jac_gen__/__init__.py +0 -0
  43. jaclang/jac/tests/fixtures/__jac_gen__/hello_world.py +16 -0
  44. jaclang/jac/tests/fixtures/fam.jac +7 -8
  45. jaclang/jac/transform.py +4 -3
  46. jaclang/jac/transpiler.py +13 -9
  47. jaclang/utils/fstring_parser.py +2 -2
  48. jaclang/utils/helpers.py +41 -0
  49. jaclang/utils/test.py +30 -0
  50. jaclang/vendor/__init__.py +1 -0
  51. jaclang/vendor/pygls/__init__.py +25 -0
  52. jaclang/vendor/pygls/capabilities.py +502 -0
  53. jaclang/vendor/pygls/client.py +176 -0
  54. jaclang/vendor/pygls/constants.py +26 -0
  55. jaclang/vendor/pygls/exceptions.py +220 -0
  56. jaclang/vendor/pygls/feature_manager.py +241 -0
  57. jaclang/vendor/pygls/lsp/__init__.py +139 -0
  58. jaclang/vendor/pygls/lsp/client.py +2224 -0
  59. jaclang/vendor/pygls/lsprotocol/__init__.py +2 -0
  60. jaclang/vendor/pygls/lsprotocol/_hooks.py +1233 -0
  61. jaclang/vendor/pygls/lsprotocol/converters.py +17 -0
  62. jaclang/vendor/pygls/lsprotocol/types.py +12820 -0
  63. jaclang/vendor/pygls/lsprotocol/validators.py +47 -0
  64. jaclang/vendor/pygls/progress.py +79 -0
  65. jaclang/vendor/pygls/protocol.py +1184 -0
  66. jaclang/vendor/pygls/server.py +620 -0
  67. jaclang/vendor/pygls/uris.py +184 -0
  68. jaclang/vendor/pygls/workspace/__init__.py +81 -0
  69. jaclang/vendor/pygls/workspace/position.py +204 -0
  70. jaclang/vendor/pygls/workspace/text_document.py +234 -0
  71. jaclang/vendor/pygls/workspace/workspace.py +311 -0
  72. {jaclang-0.0.6.dist-info → jaclang-0.0.8.dist-info}/METADATA +1 -1
  73. jaclang-0.0.8.dist-info/RECORD +118 -0
  74. jaclang/core/jaclang.jac +0 -62
  75. jaclang-0.0.6.dist-info/RECORD +0 -76
  76. /jaclang/{utils → vendor}/sly/__init__.py +0 -0
  77. /jaclang/{utils → vendor}/sly/docparse.py +0 -0
  78. /jaclang/{utils → vendor}/sly/lex.py +0 -0
  79. /jaclang/{utils → vendor}/sly/yacc.py +0 -0
  80. {jaclang-0.0.6.dist-info → jaclang-0.0.8.dist-info}/WHEEL +0 -0
  81. {jaclang-0.0.6.dist-info → jaclang-0.0.8.dist-info}/entry_points.txt +0 -0
  82. {jaclang-0.0.6.dist-info → jaclang-0.0.8.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,2224 @@
1
+ # GENERATED FROM scripts/gen-client.py -- DO NOT EDIT
2
+ # flake8: noqa
3
+ from concurrent.futures import Future
4
+ from jaclang.vendor.pygls.lsprotocol import types
5
+ from jaclang.vendor.pygls.client import JsonRPCClient
6
+ from jaclang.vendor.pygls.protocol import LanguageServerProtocol
7
+ from jaclang.vendor.pygls.protocol import default_converter
8
+ from typing import Any
9
+ from typing import Callable
10
+ from typing import List
11
+ from typing import Optional
12
+ from typing import Union
13
+
14
+
15
+ class BaseLanguageClient(JsonRPCClient):
16
+ def __init__(
17
+ self,
18
+ name: str,
19
+ version: str,
20
+ protocol_cls=LanguageServerProtocol,
21
+ converter_factory=default_converter,
22
+ **kwargs,
23
+ ):
24
+ self.name = name
25
+ self.version = version
26
+ super().__init__(protocol_cls, converter_factory, **kwargs)
27
+
28
+ def call_hierarchy_incoming_calls(
29
+ self,
30
+ params: types.CallHierarchyIncomingCallsParams,
31
+ callback: Optional[
32
+ Callable[[Optional[List[types.CallHierarchyIncomingCall]]], None]
33
+ ] = None,
34
+ ) -> Future:
35
+ """Make a :lsp:`callHierarchy/incomingCalls` request.
36
+
37
+ A request to resolve the incoming calls for a given `CallHierarchyItem`.
38
+
39
+ @since 3.16.0
40
+ """
41
+ if self.stopped:
42
+ raise RuntimeError("Client has been stopped.")
43
+
44
+ return self.protocol.send_request(
45
+ "callHierarchy/incomingCalls", params, callback
46
+ )
47
+
48
+ async def call_hierarchy_incoming_calls_async(
49
+ self,
50
+ params: types.CallHierarchyIncomingCallsParams,
51
+ ) -> Optional[List[types.CallHierarchyIncomingCall]]:
52
+ """Make a :lsp:`callHierarchy/incomingCalls` request.
53
+
54
+ A request to resolve the incoming calls for a given `CallHierarchyItem`.
55
+
56
+ @since 3.16.0
57
+ """
58
+ if self.stopped:
59
+ raise RuntimeError("Client has been stopped.")
60
+
61
+ return await self.protocol.send_request_async(
62
+ "callHierarchy/incomingCalls", params
63
+ )
64
+
65
+ def call_hierarchy_outgoing_calls(
66
+ self,
67
+ params: types.CallHierarchyOutgoingCallsParams,
68
+ callback: Optional[
69
+ Callable[[Optional[List[types.CallHierarchyOutgoingCall]]], None]
70
+ ] = None,
71
+ ) -> Future:
72
+ """Make a :lsp:`callHierarchy/outgoingCalls` request.
73
+
74
+ A request to resolve the outgoing calls for a given `CallHierarchyItem`.
75
+
76
+ @since 3.16.0
77
+ """
78
+ if self.stopped:
79
+ raise RuntimeError("Client has been stopped.")
80
+
81
+ return self.protocol.send_request(
82
+ "callHierarchy/outgoingCalls", params, callback
83
+ )
84
+
85
+ async def call_hierarchy_outgoing_calls_async(
86
+ self,
87
+ params: types.CallHierarchyOutgoingCallsParams,
88
+ ) -> Optional[List[types.CallHierarchyOutgoingCall]]:
89
+ """Make a :lsp:`callHierarchy/outgoingCalls` request.
90
+
91
+ A request to resolve the outgoing calls for a given `CallHierarchyItem`.
92
+
93
+ @since 3.16.0
94
+ """
95
+ if self.stopped:
96
+ raise RuntimeError("Client has been stopped.")
97
+
98
+ return await self.protocol.send_request_async(
99
+ "callHierarchy/outgoingCalls", params
100
+ )
101
+
102
+ def code_action_resolve(
103
+ self,
104
+ params: types.CodeAction,
105
+ callback: Optional[Callable[[types.CodeAction], None]] = None,
106
+ ) -> Future:
107
+ """Make a :lsp:`codeAction/resolve` request.
108
+
109
+ Request to resolve additional information for a given code action.The request's
110
+ parameter is of type {@link CodeAction} the response
111
+ is of type {@link CodeAction} or a Thenable that resolves to such.
112
+ """
113
+ if self.stopped:
114
+ raise RuntimeError("Client has been stopped.")
115
+
116
+ return self.protocol.send_request("codeAction/resolve", params, callback)
117
+
118
+ async def code_action_resolve_async(
119
+ self,
120
+ params: types.CodeAction,
121
+ ) -> types.CodeAction:
122
+ """Make a :lsp:`codeAction/resolve` request.
123
+
124
+ Request to resolve additional information for a given code action.The request's
125
+ parameter is of type {@link CodeAction} the response
126
+ is of type {@link CodeAction} or a Thenable that resolves to such.
127
+ """
128
+ if self.stopped:
129
+ raise RuntimeError("Client has been stopped.")
130
+
131
+ return await self.protocol.send_request_async("codeAction/resolve", params)
132
+
133
+ def code_lens_resolve(
134
+ self,
135
+ params: types.CodeLens,
136
+ callback: Optional[Callable[[types.CodeLens], None]] = None,
137
+ ) -> Future:
138
+ """Make a :lsp:`codeLens/resolve` request.
139
+
140
+ A request to resolve a command for a given code lens.
141
+ """
142
+ if self.stopped:
143
+ raise RuntimeError("Client has been stopped.")
144
+
145
+ return self.protocol.send_request("codeLens/resolve", params, callback)
146
+
147
+ async def code_lens_resolve_async(
148
+ self,
149
+ params: types.CodeLens,
150
+ ) -> types.CodeLens:
151
+ """Make a :lsp:`codeLens/resolve` request.
152
+
153
+ A request to resolve a command for a given code lens.
154
+ """
155
+ if self.stopped:
156
+ raise RuntimeError("Client has been stopped.")
157
+
158
+ return await self.protocol.send_request_async("codeLens/resolve", params)
159
+
160
+ def completion_item_resolve(
161
+ self,
162
+ params: types.CompletionItem,
163
+ callback: Optional[Callable[[types.CompletionItem], None]] = None,
164
+ ) -> Future:
165
+ """Make a :lsp:`completionItem/resolve` request.
166
+
167
+ Request to resolve additional information for a given completion item.The request's
168
+ parameter is of type {@link CompletionItem} the response
169
+ is of type {@link CompletionItem} or a Thenable that resolves to such.
170
+ """
171
+ if self.stopped:
172
+ raise RuntimeError("Client has been stopped.")
173
+
174
+ return self.protocol.send_request("completionItem/resolve", params, callback)
175
+
176
+ async def completion_item_resolve_async(
177
+ self,
178
+ params: types.CompletionItem,
179
+ ) -> types.CompletionItem:
180
+ """Make a :lsp:`completionItem/resolve` request.
181
+
182
+ Request to resolve additional information for a given completion item.The request's
183
+ parameter is of type {@link CompletionItem} the response
184
+ is of type {@link CompletionItem} or a Thenable that resolves to such.
185
+ """
186
+ if self.stopped:
187
+ raise RuntimeError("Client has been stopped.")
188
+
189
+ return await self.protocol.send_request_async("completionItem/resolve", params)
190
+
191
+ def document_link_resolve(
192
+ self,
193
+ params: types.DocumentLink,
194
+ callback: Optional[Callable[[types.DocumentLink], None]] = None,
195
+ ) -> Future:
196
+ """Make a :lsp:`documentLink/resolve` request.
197
+
198
+ Request to resolve additional information for a given document link. The request's
199
+ parameter is of type {@link DocumentLink} the response
200
+ is of type {@link DocumentLink} or a Thenable that resolves to such.
201
+ """
202
+ if self.stopped:
203
+ raise RuntimeError("Client has been stopped.")
204
+
205
+ return self.protocol.send_request("documentLink/resolve", params, callback)
206
+
207
+ async def document_link_resolve_async(
208
+ self,
209
+ params: types.DocumentLink,
210
+ ) -> types.DocumentLink:
211
+ """Make a :lsp:`documentLink/resolve` request.
212
+
213
+ Request to resolve additional information for a given document link. The request's
214
+ parameter is of type {@link DocumentLink} the response
215
+ is of type {@link DocumentLink} or a Thenable that resolves to such.
216
+ """
217
+ if self.stopped:
218
+ raise RuntimeError("Client has been stopped.")
219
+
220
+ return await self.protocol.send_request_async("documentLink/resolve", params)
221
+
222
+ def initialize(
223
+ self,
224
+ params: types.InitializeParams,
225
+ callback: Optional[Callable[[types.InitializeResult], None]] = None,
226
+ ) -> Future:
227
+ """Make a :lsp:`initialize` request.
228
+
229
+ The initialize request is sent from the client to the server.
230
+ It is sent once as the request after starting up the server.
231
+ The requests parameter is of type {@link InitializeParams}
232
+ the response if of type {@link InitializeResult} of a Thenable that
233
+ resolves to such.
234
+ """
235
+ if self.stopped:
236
+ raise RuntimeError("Client has been stopped.")
237
+
238
+ return self.protocol.send_request("initialize", params, callback)
239
+
240
+ async def initialize_async(
241
+ self,
242
+ params: types.InitializeParams,
243
+ ) -> types.InitializeResult:
244
+ """Make a :lsp:`initialize` request.
245
+
246
+ The initialize request is sent from the client to the server.
247
+ It is sent once as the request after starting up the server.
248
+ The requests parameter is of type {@link InitializeParams}
249
+ the response if of type {@link InitializeResult} of a Thenable that
250
+ resolves to such.
251
+ """
252
+ if self.stopped:
253
+ raise RuntimeError("Client has been stopped.")
254
+
255
+ return await self.protocol.send_request_async("initialize", params)
256
+
257
+ def inlay_hint_resolve(
258
+ self,
259
+ params: types.InlayHint,
260
+ callback: Optional[Callable[[types.InlayHint], None]] = None,
261
+ ) -> Future:
262
+ """Make a :lsp:`inlayHint/resolve` request.
263
+
264
+ A request to resolve additional properties for an inlay hint.
265
+ The request's parameter is of type {@link InlayHint}, the response is
266
+ of type {@link InlayHint} or a Thenable that resolves to such.
267
+
268
+ @since 3.17.0
269
+ """
270
+ if self.stopped:
271
+ raise RuntimeError("Client has been stopped.")
272
+
273
+ return self.protocol.send_request("inlayHint/resolve", params, callback)
274
+
275
+ async def inlay_hint_resolve_async(
276
+ self,
277
+ params: types.InlayHint,
278
+ ) -> types.InlayHint:
279
+ """Make a :lsp:`inlayHint/resolve` request.
280
+
281
+ A request to resolve additional properties for an inlay hint.
282
+ The request's parameter is of type {@link InlayHint}, the response is
283
+ of type {@link InlayHint} or a Thenable that resolves to such.
284
+
285
+ @since 3.17.0
286
+ """
287
+ if self.stopped:
288
+ raise RuntimeError("Client has been stopped.")
289
+
290
+ return await self.protocol.send_request_async("inlayHint/resolve", params)
291
+
292
+ def shutdown(
293
+ self,
294
+ params: None,
295
+ callback: Optional[Callable[[None], None]] = None,
296
+ ) -> Future:
297
+ """Make a :lsp:`shutdown` request.
298
+
299
+ A shutdown request is sent from the client to the server.
300
+ It is sent once when the client decides to shutdown the
301
+ server. The only notification that is sent after a shutdown request
302
+ is the exit event.
303
+ """
304
+ if self.stopped:
305
+ raise RuntimeError("Client has been stopped.")
306
+
307
+ return self.protocol.send_request("shutdown", params, callback)
308
+
309
+ async def shutdown_async(
310
+ self,
311
+ params: None,
312
+ ) -> None:
313
+ """Make a :lsp:`shutdown` request.
314
+
315
+ A shutdown request is sent from the client to the server.
316
+ It is sent once when the client decides to shutdown the
317
+ server. The only notification that is sent after a shutdown request
318
+ is the exit event.
319
+ """
320
+ if self.stopped:
321
+ raise RuntimeError("Client has been stopped.")
322
+
323
+ return await self.protocol.send_request_async("shutdown", params)
324
+
325
+ def text_document_code_action(
326
+ self,
327
+ params: types.CodeActionParams,
328
+ callback: Optional[
329
+ Callable[[Optional[List[Union[types.Command, types.CodeAction]]]], None]
330
+ ] = None,
331
+ ) -> Future:
332
+ """Make a :lsp:`textDocument/codeAction` request.
333
+
334
+ A request to provide commands for the given text document and range.
335
+ """
336
+ if self.stopped:
337
+ raise RuntimeError("Client has been stopped.")
338
+
339
+ return self.protocol.send_request("textDocument/codeAction", params, callback)
340
+
341
+ async def text_document_code_action_async(
342
+ self,
343
+ params: types.CodeActionParams,
344
+ ) -> Optional[List[Union[types.Command, types.CodeAction]]]:
345
+ """Make a :lsp:`textDocument/codeAction` request.
346
+
347
+ A request to provide commands for the given text document and range.
348
+ """
349
+ if self.stopped:
350
+ raise RuntimeError("Client has been stopped.")
351
+
352
+ return await self.protocol.send_request_async("textDocument/codeAction", params)
353
+
354
+ def text_document_code_lens(
355
+ self,
356
+ params: types.CodeLensParams,
357
+ callback: Optional[Callable[[Optional[List[types.CodeLens]]], None]] = None,
358
+ ) -> Future:
359
+ """Make a :lsp:`textDocument/codeLens` request.
360
+
361
+ A request to provide code lens for the given text document.
362
+ """
363
+ if self.stopped:
364
+ raise RuntimeError("Client has been stopped.")
365
+
366
+ return self.protocol.send_request("textDocument/codeLens", params, callback)
367
+
368
+ async def text_document_code_lens_async(
369
+ self,
370
+ params: types.CodeLensParams,
371
+ ) -> Optional[List[types.CodeLens]]:
372
+ """Make a :lsp:`textDocument/codeLens` request.
373
+
374
+ A request to provide code lens for the given text document.
375
+ """
376
+ if self.stopped:
377
+ raise RuntimeError("Client has been stopped.")
378
+
379
+ return await self.protocol.send_request_async("textDocument/codeLens", params)
380
+
381
+ def text_document_color_presentation(
382
+ self,
383
+ params: types.ColorPresentationParams,
384
+ callback: Optional[Callable[[List[types.ColorPresentation]], None]] = None,
385
+ ) -> Future:
386
+ """Make a :lsp:`textDocument/colorPresentation` request.
387
+
388
+ A request to list all presentation for a color. The request's
389
+ parameter is of type {@link ColorPresentationParams} the
390
+ response is of type {@link ColorInformation ColorInformation[]} or a Thenable
391
+ that resolves to such.
392
+ """
393
+ if self.stopped:
394
+ raise RuntimeError("Client has been stopped.")
395
+
396
+ return self.protocol.send_request(
397
+ "textDocument/colorPresentation", params, callback
398
+ )
399
+
400
+ async def text_document_color_presentation_async(
401
+ self,
402
+ params: types.ColorPresentationParams,
403
+ ) -> List[types.ColorPresentation]:
404
+ """Make a :lsp:`textDocument/colorPresentation` request.
405
+
406
+ A request to list all presentation for a color. The request's
407
+ parameter is of type {@link ColorPresentationParams} the
408
+ response is of type {@link ColorInformation ColorInformation[]} or a Thenable
409
+ that resolves to such.
410
+ """
411
+ if self.stopped:
412
+ raise RuntimeError("Client has been stopped.")
413
+
414
+ return await self.protocol.send_request_async(
415
+ "textDocument/colorPresentation", params
416
+ )
417
+
418
+ def text_document_completion(
419
+ self,
420
+ params: types.CompletionParams,
421
+ callback: Optional[
422
+ Callable[
423
+ [Union[List[types.CompletionItem], types.CompletionList, None]], None
424
+ ]
425
+ ] = None,
426
+ ) -> Future:
427
+ """Make a :lsp:`textDocument/completion` request.
428
+
429
+ Request to request completion at a given text document position. The request's
430
+ parameter is of type {@link TextDocumentPosition} the response
431
+ is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList}
432
+ or a Thenable that resolves to such.
433
+
434
+ The request can delay the computation of the {@link CompletionItem.detail `detail`}
435
+ and {@link CompletionItem.documentation `documentation`} properties to the `completionItem/resolve`
436
+ request. However, properties that are needed for the initial sorting and filtering, like `sortText`,
437
+ `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.
438
+ """
439
+ if self.stopped:
440
+ raise RuntimeError("Client has been stopped.")
441
+
442
+ return self.protocol.send_request("textDocument/completion", params, callback)
443
+
444
+ async def text_document_completion_async(
445
+ self,
446
+ params: types.CompletionParams,
447
+ ) -> Union[List[types.CompletionItem], types.CompletionList, None]:
448
+ """Make a :lsp:`textDocument/completion` request.
449
+
450
+ Request to request completion at a given text document position. The request's
451
+ parameter is of type {@link TextDocumentPosition} the response
452
+ is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList}
453
+ or a Thenable that resolves to such.
454
+
455
+ The request can delay the computation of the {@link CompletionItem.detail `detail`}
456
+ and {@link CompletionItem.documentation `documentation`} properties to the `completionItem/resolve`
457
+ request. However, properties that are needed for the initial sorting and filtering, like `sortText`,
458
+ `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.
459
+ """
460
+ if self.stopped:
461
+ raise RuntimeError("Client has been stopped.")
462
+
463
+ return await self.protocol.send_request_async("textDocument/completion", params)
464
+
465
+ def text_document_declaration(
466
+ self,
467
+ params: types.DeclarationParams,
468
+ callback: Optional[
469
+ Callable[
470
+ [
471
+ Union[
472
+ types.Location,
473
+ List[types.Location],
474
+ List[types.LocationLink],
475
+ None,
476
+ ]
477
+ ],
478
+ None,
479
+ ]
480
+ ] = None,
481
+ ) -> Future:
482
+ """Make a :lsp:`textDocument/declaration` request.
483
+
484
+ A request to resolve the type definition locations of a symbol at a given text
485
+ document position. The request's parameter is of type {@link TextDocumentPositionParams}
486
+ the response is of type {@link Declaration} or a typed array of {@link DeclarationLink}
487
+ or a Thenable that resolves to such.
488
+ """
489
+ if self.stopped:
490
+ raise RuntimeError("Client has been stopped.")
491
+
492
+ return self.protocol.send_request("textDocument/declaration", params, callback)
493
+
494
+ async def text_document_declaration_async(
495
+ self,
496
+ params: types.DeclarationParams,
497
+ ) -> Union[types.Location, List[types.Location], List[types.LocationLink], None]:
498
+ """Make a :lsp:`textDocument/declaration` request.
499
+
500
+ A request to resolve the type definition locations of a symbol at a given text
501
+ document position. The request's parameter is of type {@link TextDocumentPositionParams}
502
+ the response is of type {@link Declaration} or a typed array of {@link DeclarationLink}
503
+ or a Thenable that resolves to such.
504
+ """
505
+ if self.stopped:
506
+ raise RuntimeError("Client has been stopped.")
507
+
508
+ return await self.protocol.send_request_async(
509
+ "textDocument/declaration", params
510
+ )
511
+
512
+ def text_document_definition(
513
+ self,
514
+ params: types.DefinitionParams,
515
+ callback: Optional[
516
+ Callable[
517
+ [
518
+ Union[
519
+ types.Location,
520
+ List[types.Location],
521
+ List[types.LocationLink],
522
+ None,
523
+ ]
524
+ ],
525
+ None,
526
+ ]
527
+ ] = None,
528
+ ) -> Future:
529
+ """Make a :lsp:`textDocument/definition` request.
530
+
531
+ A request to resolve the definition location of a symbol at a given text
532
+ document position. The request's parameter is of type {@link TextDocumentPosition}
533
+ the response is of either type {@link Definition} or a typed array of
534
+ {@link DefinitionLink} or a Thenable that resolves to such.
535
+ """
536
+ if self.stopped:
537
+ raise RuntimeError("Client has been stopped.")
538
+
539
+ return self.protocol.send_request("textDocument/definition", params, callback)
540
+
541
+ async def text_document_definition_async(
542
+ self,
543
+ params: types.DefinitionParams,
544
+ ) -> Union[types.Location, List[types.Location], List[types.LocationLink], None]:
545
+ """Make a :lsp:`textDocument/definition` request.
546
+
547
+ A request to resolve the definition location of a symbol at a given text
548
+ document position. The request's parameter is of type {@link TextDocumentPosition}
549
+ the response is of either type {@link Definition} or a typed array of
550
+ {@link DefinitionLink} or a Thenable that resolves to such.
551
+ """
552
+ if self.stopped:
553
+ raise RuntimeError("Client has been stopped.")
554
+
555
+ return await self.protocol.send_request_async("textDocument/definition", params)
556
+
557
+ def text_document_diagnostic(
558
+ self,
559
+ params: types.DocumentDiagnosticParams,
560
+ callback: Optional[
561
+ Callable[
562
+ [
563
+ Union[
564
+ types.RelatedFullDocumentDiagnosticReport,
565
+ types.RelatedUnchangedDocumentDiagnosticReport,
566
+ ]
567
+ ],
568
+ None,
569
+ ]
570
+ ] = None,
571
+ ) -> Future:
572
+ """Make a :lsp:`textDocument/diagnostic` request.
573
+
574
+ The document diagnostic request definition.
575
+
576
+ @since 3.17.0
577
+ """
578
+ if self.stopped:
579
+ raise RuntimeError("Client has been stopped.")
580
+
581
+ return self.protocol.send_request("textDocument/diagnostic", params, callback)
582
+
583
+ async def text_document_diagnostic_async(
584
+ self,
585
+ params: types.DocumentDiagnosticParams,
586
+ ) -> Union[
587
+ types.RelatedFullDocumentDiagnosticReport,
588
+ types.RelatedUnchangedDocumentDiagnosticReport,
589
+ ]:
590
+ """Make a :lsp:`textDocument/diagnostic` request.
591
+
592
+ The document diagnostic request definition.
593
+
594
+ @since 3.17.0
595
+ """
596
+ if self.stopped:
597
+ raise RuntimeError("Client has been stopped.")
598
+
599
+ return await self.protocol.send_request_async("textDocument/diagnostic", params)
600
+
601
+ def text_document_document_color(
602
+ self,
603
+ params: types.DocumentColorParams,
604
+ callback: Optional[Callable[[List[types.ColorInformation]], None]] = None,
605
+ ) -> Future:
606
+ """Make a :lsp:`textDocument/documentColor` request.
607
+
608
+ A request to list all color symbols found in a given text document. The request's
609
+ parameter is of type {@link DocumentColorParams} the
610
+ response is of type {@link ColorInformation ColorInformation[]} or a Thenable
611
+ that resolves to such.
612
+ """
613
+ if self.stopped:
614
+ raise RuntimeError("Client has been stopped.")
615
+
616
+ return self.protocol.send_request(
617
+ "textDocument/documentColor", params, callback
618
+ )
619
+
620
+ async def text_document_document_color_async(
621
+ self,
622
+ params: types.DocumentColorParams,
623
+ ) -> List[types.ColorInformation]:
624
+ """Make a :lsp:`textDocument/documentColor` request.
625
+
626
+ A request to list all color symbols found in a given text document. The request's
627
+ parameter is of type {@link DocumentColorParams} the
628
+ response is of type {@link ColorInformation ColorInformation[]} or a Thenable
629
+ that resolves to such.
630
+ """
631
+ if self.stopped:
632
+ raise RuntimeError("Client has been stopped.")
633
+
634
+ return await self.protocol.send_request_async(
635
+ "textDocument/documentColor", params
636
+ )
637
+
638
+ def text_document_document_highlight(
639
+ self,
640
+ params: types.DocumentHighlightParams,
641
+ callback: Optional[
642
+ Callable[[Optional[List[types.DocumentHighlight]]], None]
643
+ ] = None,
644
+ ) -> Future:
645
+ """Make a :lsp:`textDocument/documentHighlight` request.
646
+
647
+ Request to resolve a {@link DocumentHighlight} for a given
648
+ text document position. The request's parameter is of type {@link TextDocumentPosition}
649
+ the request response is an array of type {@link DocumentHighlight}
650
+ or a Thenable that resolves to such.
651
+ """
652
+ if self.stopped:
653
+ raise RuntimeError("Client has been stopped.")
654
+
655
+ return self.protocol.send_request(
656
+ "textDocument/documentHighlight", params, callback
657
+ )
658
+
659
+ async def text_document_document_highlight_async(
660
+ self,
661
+ params: types.DocumentHighlightParams,
662
+ ) -> Optional[List[types.DocumentHighlight]]:
663
+ """Make a :lsp:`textDocument/documentHighlight` request.
664
+
665
+ Request to resolve a {@link DocumentHighlight} for a given
666
+ text document position. The request's parameter is of type {@link TextDocumentPosition}
667
+ the request response is an array of type {@link DocumentHighlight}
668
+ or a Thenable that resolves to such.
669
+ """
670
+ if self.stopped:
671
+ raise RuntimeError("Client has been stopped.")
672
+
673
+ return await self.protocol.send_request_async(
674
+ "textDocument/documentHighlight", params
675
+ )
676
+
677
+ def text_document_document_link(
678
+ self,
679
+ params: types.DocumentLinkParams,
680
+ callback: Optional[Callable[[Optional[List[types.DocumentLink]]], None]] = None,
681
+ ) -> Future:
682
+ """Make a :lsp:`textDocument/documentLink` request.
683
+
684
+ A request to provide document links
685
+ """
686
+ if self.stopped:
687
+ raise RuntimeError("Client has been stopped.")
688
+
689
+ return self.protocol.send_request("textDocument/documentLink", params, callback)
690
+
691
+ async def text_document_document_link_async(
692
+ self,
693
+ params: types.DocumentLinkParams,
694
+ ) -> Optional[List[types.DocumentLink]]:
695
+ """Make a :lsp:`textDocument/documentLink` request.
696
+
697
+ A request to provide document links
698
+ """
699
+ if self.stopped:
700
+ raise RuntimeError("Client has been stopped.")
701
+
702
+ return await self.protocol.send_request_async(
703
+ "textDocument/documentLink", params
704
+ )
705
+
706
+ def text_document_document_symbol(
707
+ self,
708
+ params: types.DocumentSymbolParams,
709
+ callback: Optional[
710
+ Callable[
711
+ [
712
+ Union[
713
+ List[types.SymbolInformation], List[types.DocumentSymbol], None
714
+ ]
715
+ ],
716
+ None,
717
+ ]
718
+ ] = None,
719
+ ) -> Future:
720
+ """Make a :lsp:`textDocument/documentSymbol` request.
721
+
722
+ A request to list all symbols found in a given text document. The request's
723
+ parameter is of type {@link TextDocumentIdentifier} the
724
+ response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable
725
+ that resolves to such.
726
+ """
727
+ if self.stopped:
728
+ raise RuntimeError("Client has been stopped.")
729
+
730
+ return self.protocol.send_request(
731
+ "textDocument/documentSymbol", params, callback
732
+ )
733
+
734
+ async def text_document_document_symbol_async(
735
+ self,
736
+ params: types.DocumentSymbolParams,
737
+ ) -> Union[List[types.SymbolInformation], List[types.DocumentSymbol], None]:
738
+ """Make a :lsp:`textDocument/documentSymbol` request.
739
+
740
+ A request to list all symbols found in a given text document. The request's
741
+ parameter is of type {@link TextDocumentIdentifier} the
742
+ response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable
743
+ that resolves to such.
744
+ """
745
+ if self.stopped:
746
+ raise RuntimeError("Client has been stopped.")
747
+
748
+ return await self.protocol.send_request_async(
749
+ "textDocument/documentSymbol", params
750
+ )
751
+
752
+ def text_document_folding_range(
753
+ self,
754
+ params: types.FoldingRangeParams,
755
+ callback: Optional[Callable[[Optional[List[types.FoldingRange]]], None]] = None,
756
+ ) -> Future:
757
+ """Make a :lsp:`textDocument/foldingRange` request.
758
+
759
+ A request to provide folding ranges in a document. The request's
760
+ parameter is of type {@link FoldingRangeParams}, the
761
+ response is of type {@link FoldingRangeList} or a Thenable
762
+ that resolves to such.
763
+ """
764
+ if self.stopped:
765
+ raise RuntimeError("Client has been stopped.")
766
+
767
+ return self.protocol.send_request("textDocument/foldingRange", params, callback)
768
+
769
+ async def text_document_folding_range_async(
770
+ self,
771
+ params: types.FoldingRangeParams,
772
+ ) -> Optional[List[types.FoldingRange]]:
773
+ """Make a :lsp:`textDocument/foldingRange` request.
774
+
775
+ A request to provide folding ranges in a document. The request's
776
+ parameter is of type {@link FoldingRangeParams}, the
777
+ response is of type {@link FoldingRangeList} or a Thenable
778
+ that resolves to such.
779
+ """
780
+ if self.stopped:
781
+ raise RuntimeError("Client has been stopped.")
782
+
783
+ return await self.protocol.send_request_async(
784
+ "textDocument/foldingRange", params
785
+ )
786
+
787
+ def text_document_formatting(
788
+ self,
789
+ params: types.DocumentFormattingParams,
790
+ callback: Optional[Callable[[Optional[List[types.TextEdit]]], None]] = None,
791
+ ) -> Future:
792
+ """Make a :lsp:`textDocument/formatting` request.
793
+
794
+ A request to format a whole document.
795
+ """
796
+ if self.stopped:
797
+ raise RuntimeError("Client has been stopped.")
798
+
799
+ return self.protocol.send_request("textDocument/formatting", params, callback)
800
+
801
+ async def text_document_formatting_async(
802
+ self,
803
+ params: types.DocumentFormattingParams,
804
+ ) -> Optional[List[types.TextEdit]]:
805
+ """Make a :lsp:`textDocument/formatting` request.
806
+
807
+ A request to format a whole document.
808
+ """
809
+ if self.stopped:
810
+ raise RuntimeError("Client has been stopped.")
811
+
812
+ return await self.protocol.send_request_async("textDocument/formatting", params)
813
+
814
+ def text_document_hover(
815
+ self,
816
+ params: types.HoverParams,
817
+ callback: Optional[Callable[[Optional[types.Hover]], None]] = None,
818
+ ) -> Future:
819
+ """Make a :lsp:`textDocument/hover` request.
820
+
821
+ Request to request hover information at a given text document position. The request's
822
+ parameter is of type {@link TextDocumentPosition} the response is of
823
+ type {@link Hover} or a Thenable that resolves to such.
824
+ """
825
+ if self.stopped:
826
+ raise RuntimeError("Client has been stopped.")
827
+
828
+ return self.protocol.send_request("textDocument/hover", params, callback)
829
+
830
+ async def text_document_hover_async(
831
+ self,
832
+ params: types.HoverParams,
833
+ ) -> Optional[types.Hover]:
834
+ """Make a :lsp:`textDocument/hover` request.
835
+
836
+ Request to request hover information at a given text document position. The request's
837
+ parameter is of type {@link TextDocumentPosition} the response is of
838
+ type {@link Hover} or a Thenable that resolves to such.
839
+ """
840
+ if self.stopped:
841
+ raise RuntimeError("Client has been stopped.")
842
+
843
+ return await self.protocol.send_request_async("textDocument/hover", params)
844
+
845
+ def text_document_implementation(
846
+ self,
847
+ params: types.ImplementationParams,
848
+ callback: Optional[
849
+ Callable[
850
+ [
851
+ Union[
852
+ types.Location,
853
+ List[types.Location],
854
+ List[types.LocationLink],
855
+ None,
856
+ ]
857
+ ],
858
+ None,
859
+ ]
860
+ ] = None,
861
+ ) -> Future:
862
+ """Make a :lsp:`textDocument/implementation` request.
863
+
864
+ A request to resolve the implementation locations of a symbol at a given text
865
+ document position. The request's parameter is of type {@link TextDocumentPositionParams}
866
+ the response is of type {@link Definition} or a Thenable that resolves to such.
867
+ """
868
+ if self.stopped:
869
+ raise RuntimeError("Client has been stopped.")
870
+
871
+ return self.protocol.send_request(
872
+ "textDocument/implementation", params, callback
873
+ )
874
+
875
+ async def text_document_implementation_async(
876
+ self,
877
+ params: types.ImplementationParams,
878
+ ) -> Union[types.Location, List[types.Location], List[types.LocationLink], None]:
879
+ """Make a :lsp:`textDocument/implementation` request.
880
+
881
+ A request to resolve the implementation locations of a symbol at a given text
882
+ document position. The request's parameter is of type {@link TextDocumentPositionParams}
883
+ the response is of type {@link Definition} or a Thenable that resolves to such.
884
+ """
885
+ if self.stopped:
886
+ raise RuntimeError("Client has been stopped.")
887
+
888
+ return await self.protocol.send_request_async(
889
+ "textDocument/implementation", params
890
+ )
891
+
892
+ def text_document_inlay_hint(
893
+ self,
894
+ params: types.InlayHintParams,
895
+ callback: Optional[Callable[[Optional[List[types.InlayHint]]], None]] = None,
896
+ ) -> Future:
897
+ """Make a :lsp:`textDocument/inlayHint` request.
898
+
899
+ A request to provide inlay hints in a document. The request's parameter is of
900
+ type {@link InlayHintsParams}, the response is of type
901
+ {@link InlayHint InlayHint[]} or a Thenable that resolves to such.
902
+
903
+ @since 3.17.0
904
+ """
905
+ if self.stopped:
906
+ raise RuntimeError("Client has been stopped.")
907
+
908
+ return self.protocol.send_request("textDocument/inlayHint", params, callback)
909
+
910
+ async def text_document_inlay_hint_async(
911
+ self,
912
+ params: types.InlayHintParams,
913
+ ) -> Optional[List[types.InlayHint]]:
914
+ """Make a :lsp:`textDocument/inlayHint` request.
915
+
916
+ A request to provide inlay hints in a document. The request's parameter is of
917
+ type {@link InlayHintsParams}, the response is of type
918
+ {@link InlayHint InlayHint[]} or a Thenable that resolves to such.
919
+
920
+ @since 3.17.0
921
+ """
922
+ if self.stopped:
923
+ raise RuntimeError("Client has been stopped.")
924
+
925
+ return await self.protocol.send_request_async("textDocument/inlayHint", params)
926
+
927
+ def text_document_inline_completion(
928
+ self,
929
+ params: types.InlineCompletionParams,
930
+ callback: Optional[
931
+ Callable[
932
+ [
933
+ Union[
934
+ types.InlineCompletionList,
935
+ List[types.InlineCompletionItem],
936
+ None,
937
+ ]
938
+ ],
939
+ None,
940
+ ]
941
+ ] = None,
942
+ ) -> Future:
943
+ """Make a :lsp:`textDocument/inlineCompletion` request.
944
+
945
+ A request to provide inline completions in a document. The request's parameter is of
946
+ type {@link InlineCompletionParams}, the response is of type
947
+ {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.
948
+
949
+ @since 3.18.0
950
+ @proposed
951
+ """
952
+ if self.stopped:
953
+ raise RuntimeError("Client has been stopped.")
954
+
955
+ return self.protocol.send_request(
956
+ "textDocument/inlineCompletion", params, callback
957
+ )
958
+
959
+ async def text_document_inline_completion_async(
960
+ self,
961
+ params: types.InlineCompletionParams,
962
+ ) -> Union[types.InlineCompletionList, List[types.InlineCompletionItem], None]:
963
+ """Make a :lsp:`textDocument/inlineCompletion` request.
964
+
965
+ A request to provide inline completions in a document. The request's parameter is of
966
+ type {@link InlineCompletionParams}, the response is of type
967
+ {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.
968
+
969
+ @since 3.18.0
970
+ @proposed
971
+ """
972
+ if self.stopped:
973
+ raise RuntimeError("Client has been stopped.")
974
+
975
+ return await self.protocol.send_request_async(
976
+ "textDocument/inlineCompletion", params
977
+ )
978
+
979
+ def text_document_inline_value(
980
+ self,
981
+ params: types.InlineValueParams,
982
+ callback: Optional[
983
+ Callable[
984
+ [
985
+ Optional[
986
+ List[
987
+ Union[
988
+ types.InlineValueText,
989
+ types.InlineValueVariableLookup,
990
+ types.InlineValueEvaluatableExpression,
991
+ ]
992
+ ]
993
+ ]
994
+ ],
995
+ None,
996
+ ]
997
+ ] = None,
998
+ ) -> Future:
999
+ """Make a :lsp:`textDocument/inlineValue` request.
1000
+
1001
+ A request to provide inline values in a document. The request's parameter is of
1002
+ type {@link InlineValueParams}, the response is of type
1003
+ {@link InlineValue InlineValue[]} or a Thenable that resolves to such.
1004
+
1005
+ @since 3.17.0
1006
+ """
1007
+ if self.stopped:
1008
+ raise RuntimeError("Client has been stopped.")
1009
+
1010
+ return self.protocol.send_request("textDocument/inlineValue", params, callback)
1011
+
1012
+ async def text_document_inline_value_async(
1013
+ self,
1014
+ params: types.InlineValueParams,
1015
+ ) -> Optional[
1016
+ List[
1017
+ Union[
1018
+ types.InlineValueText,
1019
+ types.InlineValueVariableLookup,
1020
+ types.InlineValueEvaluatableExpression,
1021
+ ]
1022
+ ]
1023
+ ]:
1024
+ """Make a :lsp:`textDocument/inlineValue` request.
1025
+
1026
+ A request to provide inline values in a document. The request's parameter is of
1027
+ type {@link InlineValueParams}, the response is of type
1028
+ {@link InlineValue InlineValue[]} or a Thenable that resolves to such.
1029
+
1030
+ @since 3.17.0
1031
+ """
1032
+ if self.stopped:
1033
+ raise RuntimeError("Client has been stopped.")
1034
+
1035
+ return await self.protocol.send_request_async(
1036
+ "textDocument/inlineValue", params
1037
+ )
1038
+
1039
+ def text_document_linked_editing_range(
1040
+ self,
1041
+ params: types.LinkedEditingRangeParams,
1042
+ callback: Optional[
1043
+ Callable[[Optional[types.LinkedEditingRanges]], None]
1044
+ ] = None,
1045
+ ) -> Future:
1046
+ """Make a :lsp:`textDocument/linkedEditingRange` request.
1047
+
1048
+ A request to provide ranges that can be edited together.
1049
+
1050
+ @since 3.16.0
1051
+ """
1052
+ if self.stopped:
1053
+ raise RuntimeError("Client has been stopped.")
1054
+
1055
+ return self.protocol.send_request(
1056
+ "textDocument/linkedEditingRange", params, callback
1057
+ )
1058
+
1059
+ async def text_document_linked_editing_range_async(
1060
+ self,
1061
+ params: types.LinkedEditingRangeParams,
1062
+ ) -> Optional[types.LinkedEditingRanges]:
1063
+ """Make a :lsp:`textDocument/linkedEditingRange` request.
1064
+
1065
+ A request to provide ranges that can be edited together.
1066
+
1067
+ @since 3.16.0
1068
+ """
1069
+ if self.stopped:
1070
+ raise RuntimeError("Client has been stopped.")
1071
+
1072
+ return await self.protocol.send_request_async(
1073
+ "textDocument/linkedEditingRange", params
1074
+ )
1075
+
1076
+ def text_document_moniker(
1077
+ self,
1078
+ params: types.MonikerParams,
1079
+ callback: Optional[Callable[[Optional[List[types.Moniker]]], None]] = None,
1080
+ ) -> Future:
1081
+ """Make a :lsp:`textDocument/moniker` request.
1082
+
1083
+ A request to get the moniker of a symbol at a given text document position.
1084
+ The request parameter is of type {@link TextDocumentPositionParams}.
1085
+ The response is of type {@link Moniker Moniker[]} or `null`.
1086
+ """
1087
+ if self.stopped:
1088
+ raise RuntimeError("Client has been stopped.")
1089
+
1090
+ return self.protocol.send_request("textDocument/moniker", params, callback)
1091
+
1092
+ async def text_document_moniker_async(
1093
+ self,
1094
+ params: types.MonikerParams,
1095
+ ) -> Optional[List[types.Moniker]]:
1096
+ """Make a :lsp:`textDocument/moniker` request.
1097
+
1098
+ A request to get the moniker of a symbol at a given text document position.
1099
+ The request parameter is of type {@link TextDocumentPositionParams}.
1100
+ The response is of type {@link Moniker Moniker[]} or `null`.
1101
+ """
1102
+ if self.stopped:
1103
+ raise RuntimeError("Client has been stopped.")
1104
+
1105
+ return await self.protocol.send_request_async("textDocument/moniker", params)
1106
+
1107
+ def text_document_on_type_formatting(
1108
+ self,
1109
+ params: types.DocumentOnTypeFormattingParams,
1110
+ callback: Optional[Callable[[Optional[List[types.TextEdit]]], None]] = None,
1111
+ ) -> Future:
1112
+ """Make a :lsp:`textDocument/onTypeFormatting` request.
1113
+
1114
+ A request to format a document on type.
1115
+ """
1116
+ if self.stopped:
1117
+ raise RuntimeError("Client has been stopped.")
1118
+
1119
+ return self.protocol.send_request(
1120
+ "textDocument/onTypeFormatting", params, callback
1121
+ )
1122
+
1123
+ async def text_document_on_type_formatting_async(
1124
+ self,
1125
+ params: types.DocumentOnTypeFormattingParams,
1126
+ ) -> Optional[List[types.TextEdit]]:
1127
+ """Make a :lsp:`textDocument/onTypeFormatting` request.
1128
+
1129
+ A request to format a document on type.
1130
+ """
1131
+ if self.stopped:
1132
+ raise RuntimeError("Client has been stopped.")
1133
+
1134
+ return await self.protocol.send_request_async(
1135
+ "textDocument/onTypeFormatting", params
1136
+ )
1137
+
1138
+ def text_document_prepare_call_hierarchy(
1139
+ self,
1140
+ params: types.CallHierarchyPrepareParams,
1141
+ callback: Optional[
1142
+ Callable[[Optional[List[types.CallHierarchyItem]]], None]
1143
+ ] = None,
1144
+ ) -> Future:
1145
+ """Make a :lsp:`textDocument/prepareCallHierarchy` request.
1146
+
1147
+ A request to result a `CallHierarchyItem` in a document at a given position.
1148
+ Can be used as an input to an incoming or outgoing call hierarchy.
1149
+
1150
+ @since 3.16.0
1151
+ """
1152
+ if self.stopped:
1153
+ raise RuntimeError("Client has been stopped.")
1154
+
1155
+ return self.protocol.send_request(
1156
+ "textDocument/prepareCallHierarchy", params, callback
1157
+ )
1158
+
1159
+ async def text_document_prepare_call_hierarchy_async(
1160
+ self,
1161
+ params: types.CallHierarchyPrepareParams,
1162
+ ) -> Optional[List[types.CallHierarchyItem]]:
1163
+ """Make a :lsp:`textDocument/prepareCallHierarchy` request.
1164
+
1165
+ A request to result a `CallHierarchyItem` in a document at a given position.
1166
+ Can be used as an input to an incoming or outgoing call hierarchy.
1167
+
1168
+ @since 3.16.0
1169
+ """
1170
+ if self.stopped:
1171
+ raise RuntimeError("Client has been stopped.")
1172
+
1173
+ return await self.protocol.send_request_async(
1174
+ "textDocument/prepareCallHierarchy", params
1175
+ )
1176
+
1177
+ def text_document_prepare_rename(
1178
+ self,
1179
+ params: types.PrepareRenameParams,
1180
+ callback: Optional[
1181
+ Callable[
1182
+ [
1183
+ Union[
1184
+ types.Range,
1185
+ types.PrepareRenameResult_Type1,
1186
+ types.PrepareRenameResult_Type2,
1187
+ None,
1188
+ ]
1189
+ ],
1190
+ None,
1191
+ ]
1192
+ ] = None,
1193
+ ) -> Future:
1194
+ """Make a :lsp:`textDocument/prepareRename` request.
1195
+
1196
+ A request to test and perform the setup necessary for a rename.
1197
+
1198
+ @since 3.16 - support for default behavior
1199
+ """
1200
+ if self.stopped:
1201
+ raise RuntimeError("Client has been stopped.")
1202
+
1203
+ return self.protocol.send_request(
1204
+ "textDocument/prepareRename", params, callback
1205
+ )
1206
+
1207
+ async def text_document_prepare_rename_async(
1208
+ self,
1209
+ params: types.PrepareRenameParams,
1210
+ ) -> Union[
1211
+ types.Range,
1212
+ types.PrepareRenameResult_Type1,
1213
+ types.PrepareRenameResult_Type2,
1214
+ None,
1215
+ ]:
1216
+ """Make a :lsp:`textDocument/prepareRename` request.
1217
+
1218
+ A request to test and perform the setup necessary for a rename.
1219
+
1220
+ @since 3.16 - support for default behavior
1221
+ """
1222
+ if self.stopped:
1223
+ raise RuntimeError("Client has been stopped.")
1224
+
1225
+ return await self.protocol.send_request_async(
1226
+ "textDocument/prepareRename", params
1227
+ )
1228
+
1229
+ def text_document_prepare_type_hierarchy(
1230
+ self,
1231
+ params: types.TypeHierarchyPrepareParams,
1232
+ callback: Optional[
1233
+ Callable[[Optional[List[types.TypeHierarchyItem]]], None]
1234
+ ] = None,
1235
+ ) -> Future:
1236
+ """Make a :lsp:`textDocument/prepareTypeHierarchy` request.
1237
+
1238
+ A request to result a `TypeHierarchyItem` in a document at a given position.
1239
+ Can be used as an input to a subtypes or supertypes type hierarchy.
1240
+
1241
+ @since 3.17.0
1242
+ """
1243
+ if self.stopped:
1244
+ raise RuntimeError("Client has been stopped.")
1245
+
1246
+ return self.protocol.send_request(
1247
+ "textDocument/prepareTypeHierarchy", params, callback
1248
+ )
1249
+
1250
+ async def text_document_prepare_type_hierarchy_async(
1251
+ self,
1252
+ params: types.TypeHierarchyPrepareParams,
1253
+ ) -> Optional[List[types.TypeHierarchyItem]]:
1254
+ """Make a :lsp:`textDocument/prepareTypeHierarchy` request.
1255
+
1256
+ A request to result a `TypeHierarchyItem` in a document at a given position.
1257
+ Can be used as an input to a subtypes or supertypes type hierarchy.
1258
+
1259
+ @since 3.17.0
1260
+ """
1261
+ if self.stopped:
1262
+ raise RuntimeError("Client has been stopped.")
1263
+
1264
+ return await self.protocol.send_request_async(
1265
+ "textDocument/prepareTypeHierarchy", params
1266
+ )
1267
+
1268
+ def text_document_ranges_formatting(
1269
+ self,
1270
+ params: types.DocumentRangesFormattingParams,
1271
+ callback: Optional[Callable[[Optional[List[types.TextEdit]]], None]] = None,
1272
+ ) -> Future:
1273
+ """Make a :lsp:`textDocument/rangesFormatting` request.
1274
+
1275
+ A request to format ranges in a document.
1276
+
1277
+ @since 3.18.0
1278
+ @proposed
1279
+ """
1280
+ if self.stopped:
1281
+ raise RuntimeError("Client has been stopped.")
1282
+
1283
+ return self.protocol.send_request(
1284
+ "textDocument/rangesFormatting", params, callback
1285
+ )
1286
+
1287
+ async def text_document_ranges_formatting_async(
1288
+ self,
1289
+ params: types.DocumentRangesFormattingParams,
1290
+ ) -> Optional[List[types.TextEdit]]:
1291
+ """Make a :lsp:`textDocument/rangesFormatting` request.
1292
+
1293
+ A request to format ranges in a document.
1294
+
1295
+ @since 3.18.0
1296
+ @proposed
1297
+ """
1298
+ if self.stopped:
1299
+ raise RuntimeError("Client has been stopped.")
1300
+
1301
+ return await self.protocol.send_request_async(
1302
+ "textDocument/rangesFormatting", params
1303
+ )
1304
+
1305
+ def text_document_range_formatting(
1306
+ self,
1307
+ params: types.DocumentRangeFormattingParams,
1308
+ callback: Optional[Callable[[Optional[List[types.TextEdit]]], None]] = None,
1309
+ ) -> Future:
1310
+ """Make a :lsp:`textDocument/rangeFormatting` request.
1311
+
1312
+ A request to format a range in a document.
1313
+ """
1314
+ if self.stopped:
1315
+ raise RuntimeError("Client has been stopped.")
1316
+
1317
+ return self.protocol.send_request(
1318
+ "textDocument/rangeFormatting", params, callback
1319
+ )
1320
+
1321
+ async def text_document_range_formatting_async(
1322
+ self,
1323
+ params: types.DocumentRangeFormattingParams,
1324
+ ) -> Optional[List[types.TextEdit]]:
1325
+ """Make a :lsp:`textDocument/rangeFormatting` request.
1326
+
1327
+ A request to format a range in a document.
1328
+ """
1329
+ if self.stopped:
1330
+ raise RuntimeError("Client has been stopped.")
1331
+
1332
+ return await self.protocol.send_request_async(
1333
+ "textDocument/rangeFormatting", params
1334
+ )
1335
+
1336
+ def text_document_references(
1337
+ self,
1338
+ params: types.ReferenceParams,
1339
+ callback: Optional[Callable[[Optional[List[types.Location]]], None]] = None,
1340
+ ) -> Future:
1341
+ """Make a :lsp:`textDocument/references` request.
1342
+
1343
+ A request to resolve project-wide references for the symbol denoted
1344
+ by the given text document position. The request's parameter is of
1345
+ type {@link ReferenceParams} the response is of type
1346
+ {@link Location Location[]} or a Thenable that resolves to such.
1347
+ """
1348
+ if self.stopped:
1349
+ raise RuntimeError("Client has been stopped.")
1350
+
1351
+ return self.protocol.send_request("textDocument/references", params, callback)
1352
+
1353
+ async def text_document_references_async(
1354
+ self,
1355
+ params: types.ReferenceParams,
1356
+ ) -> Optional[List[types.Location]]:
1357
+ """Make a :lsp:`textDocument/references` request.
1358
+
1359
+ A request to resolve project-wide references for the symbol denoted
1360
+ by the given text document position. The request's parameter is of
1361
+ type {@link ReferenceParams} the response is of type
1362
+ {@link Location Location[]} or a Thenable that resolves to such.
1363
+ """
1364
+ if self.stopped:
1365
+ raise RuntimeError("Client has been stopped.")
1366
+
1367
+ return await self.protocol.send_request_async("textDocument/references", params)
1368
+
1369
+ def text_document_rename(
1370
+ self,
1371
+ params: types.RenameParams,
1372
+ callback: Optional[Callable[[Optional[types.WorkspaceEdit]], None]] = None,
1373
+ ) -> Future:
1374
+ """Make a :lsp:`textDocument/rename` request.
1375
+
1376
+ A request to rename a symbol.
1377
+ """
1378
+ if self.stopped:
1379
+ raise RuntimeError("Client has been stopped.")
1380
+
1381
+ return self.protocol.send_request("textDocument/rename", params, callback)
1382
+
1383
+ async def text_document_rename_async(
1384
+ self,
1385
+ params: types.RenameParams,
1386
+ ) -> Optional[types.WorkspaceEdit]:
1387
+ """Make a :lsp:`textDocument/rename` request.
1388
+
1389
+ A request to rename a symbol.
1390
+ """
1391
+ if self.stopped:
1392
+ raise RuntimeError("Client has been stopped.")
1393
+
1394
+ return await self.protocol.send_request_async("textDocument/rename", params)
1395
+
1396
+ def text_document_selection_range(
1397
+ self,
1398
+ params: types.SelectionRangeParams,
1399
+ callback: Optional[
1400
+ Callable[[Optional[List[types.SelectionRange]]], None]
1401
+ ] = None,
1402
+ ) -> Future:
1403
+ """Make a :lsp:`textDocument/selectionRange` request.
1404
+
1405
+ A request to provide selection ranges in a document. The request's
1406
+ parameter is of type {@link SelectionRangeParams}, the
1407
+ response is of type {@link SelectionRange SelectionRange[]} or a Thenable
1408
+ that resolves to such.
1409
+ """
1410
+ if self.stopped:
1411
+ raise RuntimeError("Client has been stopped.")
1412
+
1413
+ return self.protocol.send_request(
1414
+ "textDocument/selectionRange", params, callback
1415
+ )
1416
+
1417
+ async def text_document_selection_range_async(
1418
+ self,
1419
+ params: types.SelectionRangeParams,
1420
+ ) -> Optional[List[types.SelectionRange]]:
1421
+ """Make a :lsp:`textDocument/selectionRange` request.
1422
+
1423
+ A request to provide selection ranges in a document. The request's
1424
+ parameter is of type {@link SelectionRangeParams}, the
1425
+ response is of type {@link SelectionRange SelectionRange[]} or a Thenable
1426
+ that resolves to such.
1427
+ """
1428
+ if self.stopped:
1429
+ raise RuntimeError("Client has been stopped.")
1430
+
1431
+ return await self.protocol.send_request_async(
1432
+ "textDocument/selectionRange", params
1433
+ )
1434
+
1435
+ def text_document_semantic_tokens_full(
1436
+ self,
1437
+ params: types.SemanticTokensParams,
1438
+ callback: Optional[Callable[[Optional[types.SemanticTokens]], None]] = None,
1439
+ ) -> Future:
1440
+ """Make a :lsp:`textDocument/semanticTokens/full` request.
1441
+
1442
+ @since 3.16.0
1443
+ """
1444
+ if self.stopped:
1445
+ raise RuntimeError("Client has been stopped.")
1446
+
1447
+ return self.protocol.send_request(
1448
+ "textDocument/semanticTokens/full", params, callback
1449
+ )
1450
+
1451
+ async def text_document_semantic_tokens_full_async(
1452
+ self,
1453
+ params: types.SemanticTokensParams,
1454
+ ) -> Optional[types.SemanticTokens]:
1455
+ """Make a :lsp:`textDocument/semanticTokens/full` request.
1456
+
1457
+ @since 3.16.0
1458
+ """
1459
+ if self.stopped:
1460
+ raise RuntimeError("Client has been stopped.")
1461
+
1462
+ return await self.protocol.send_request_async(
1463
+ "textDocument/semanticTokens/full", params
1464
+ )
1465
+
1466
+ def text_document_semantic_tokens_full_delta(
1467
+ self,
1468
+ params: types.SemanticTokensDeltaParams,
1469
+ callback: Optional[
1470
+ Callable[
1471
+ [Union[types.SemanticTokens, types.SemanticTokensDelta, None]], None
1472
+ ]
1473
+ ] = None,
1474
+ ) -> Future:
1475
+ """Make a :lsp:`textDocument/semanticTokens/full/delta` request.
1476
+
1477
+ @since 3.16.0
1478
+ """
1479
+ if self.stopped:
1480
+ raise RuntimeError("Client has been stopped.")
1481
+
1482
+ return self.protocol.send_request(
1483
+ "textDocument/semanticTokens/full/delta", params, callback
1484
+ )
1485
+
1486
+ async def text_document_semantic_tokens_full_delta_async(
1487
+ self,
1488
+ params: types.SemanticTokensDeltaParams,
1489
+ ) -> Union[types.SemanticTokens, types.SemanticTokensDelta, None]:
1490
+ """Make a :lsp:`textDocument/semanticTokens/full/delta` request.
1491
+
1492
+ @since 3.16.0
1493
+ """
1494
+ if self.stopped:
1495
+ raise RuntimeError("Client has been stopped.")
1496
+
1497
+ return await self.protocol.send_request_async(
1498
+ "textDocument/semanticTokens/full/delta", params
1499
+ )
1500
+
1501
+ def text_document_semantic_tokens_range(
1502
+ self,
1503
+ params: types.SemanticTokensRangeParams,
1504
+ callback: Optional[Callable[[Optional[types.SemanticTokens]], None]] = None,
1505
+ ) -> Future:
1506
+ """Make a :lsp:`textDocument/semanticTokens/range` request.
1507
+
1508
+ @since 3.16.0
1509
+ """
1510
+ if self.stopped:
1511
+ raise RuntimeError("Client has been stopped.")
1512
+
1513
+ return self.protocol.send_request(
1514
+ "textDocument/semanticTokens/range", params, callback
1515
+ )
1516
+
1517
+ async def text_document_semantic_tokens_range_async(
1518
+ self,
1519
+ params: types.SemanticTokensRangeParams,
1520
+ ) -> Optional[types.SemanticTokens]:
1521
+ """Make a :lsp:`textDocument/semanticTokens/range` request.
1522
+
1523
+ @since 3.16.0
1524
+ """
1525
+ if self.stopped:
1526
+ raise RuntimeError("Client has been stopped.")
1527
+
1528
+ return await self.protocol.send_request_async(
1529
+ "textDocument/semanticTokens/range", params
1530
+ )
1531
+
1532
+ def text_document_signature_help(
1533
+ self,
1534
+ params: types.SignatureHelpParams,
1535
+ callback: Optional[Callable[[Optional[types.SignatureHelp]], None]] = None,
1536
+ ) -> Future:
1537
+ """Make a :lsp:`textDocument/signatureHelp` request."""
1538
+ if self.stopped:
1539
+ raise RuntimeError("Client has been stopped.")
1540
+
1541
+ return self.protocol.send_request(
1542
+ "textDocument/signatureHelp", params, callback
1543
+ )
1544
+
1545
+ async def text_document_signature_help_async(
1546
+ self,
1547
+ params: types.SignatureHelpParams,
1548
+ ) -> Optional[types.SignatureHelp]:
1549
+ """Make a :lsp:`textDocument/signatureHelp` request."""
1550
+ if self.stopped:
1551
+ raise RuntimeError("Client has been stopped.")
1552
+
1553
+ return await self.protocol.send_request_async(
1554
+ "textDocument/signatureHelp", params
1555
+ )
1556
+
1557
+ def text_document_type_definition(
1558
+ self,
1559
+ params: types.TypeDefinitionParams,
1560
+ callback: Optional[
1561
+ Callable[
1562
+ [
1563
+ Union[
1564
+ types.Location,
1565
+ List[types.Location],
1566
+ List[types.LocationLink],
1567
+ None,
1568
+ ]
1569
+ ],
1570
+ None,
1571
+ ]
1572
+ ] = None,
1573
+ ) -> Future:
1574
+ """Make a :lsp:`textDocument/typeDefinition` request.
1575
+
1576
+ A request to resolve the type definition locations of a symbol at a given text
1577
+ document position. The request's parameter is of type {@link TextDocumentPositionParams}
1578
+ the response is of type {@link Definition} or a Thenable that resolves to such.
1579
+ """
1580
+ if self.stopped:
1581
+ raise RuntimeError("Client has been stopped.")
1582
+
1583
+ return self.protocol.send_request(
1584
+ "textDocument/typeDefinition", params, callback
1585
+ )
1586
+
1587
+ async def text_document_type_definition_async(
1588
+ self,
1589
+ params: types.TypeDefinitionParams,
1590
+ ) -> Union[types.Location, List[types.Location], List[types.LocationLink], None]:
1591
+ """Make a :lsp:`textDocument/typeDefinition` request.
1592
+
1593
+ A request to resolve the type definition locations of a symbol at a given text
1594
+ document position. The request's parameter is of type {@link TextDocumentPositionParams}
1595
+ the response is of type {@link Definition} or a Thenable that resolves to such.
1596
+ """
1597
+ if self.stopped:
1598
+ raise RuntimeError("Client has been stopped.")
1599
+
1600
+ return await self.protocol.send_request_async(
1601
+ "textDocument/typeDefinition", params
1602
+ )
1603
+
1604
+ def text_document_will_save_wait_until(
1605
+ self,
1606
+ params: types.WillSaveTextDocumentParams,
1607
+ callback: Optional[Callable[[Optional[List[types.TextEdit]]], None]] = None,
1608
+ ) -> Future:
1609
+ """Make a :lsp:`textDocument/willSaveWaitUntil` request.
1610
+
1611
+ A document will save request is sent from the client to the server before
1612
+ the document is actually saved. The request can return an array of TextEdits
1613
+ which will be applied to the text document before it is saved. Please note that
1614
+ clients might drop results if computing the text edits took too long or if a
1615
+ server constantly fails on this request. This is done to keep the save fast and
1616
+ reliable.
1617
+ """
1618
+ if self.stopped:
1619
+ raise RuntimeError("Client has been stopped.")
1620
+
1621
+ return self.protocol.send_request(
1622
+ "textDocument/willSaveWaitUntil", params, callback
1623
+ )
1624
+
1625
+ async def text_document_will_save_wait_until_async(
1626
+ self,
1627
+ params: types.WillSaveTextDocumentParams,
1628
+ ) -> Optional[List[types.TextEdit]]:
1629
+ """Make a :lsp:`textDocument/willSaveWaitUntil` request.
1630
+
1631
+ A document will save request is sent from the client to the server before
1632
+ the document is actually saved. The request can return an array of TextEdits
1633
+ which will be applied to the text document before it is saved. Please note that
1634
+ clients might drop results if computing the text edits took too long or if a
1635
+ server constantly fails on this request. This is done to keep the save fast and
1636
+ reliable.
1637
+ """
1638
+ if self.stopped:
1639
+ raise RuntimeError("Client has been stopped.")
1640
+
1641
+ return await self.protocol.send_request_async(
1642
+ "textDocument/willSaveWaitUntil", params
1643
+ )
1644
+
1645
+ def type_hierarchy_subtypes(
1646
+ self,
1647
+ params: types.TypeHierarchySubtypesParams,
1648
+ callback: Optional[
1649
+ Callable[[Optional[List[types.TypeHierarchyItem]]], None]
1650
+ ] = None,
1651
+ ) -> Future:
1652
+ """Make a :lsp:`typeHierarchy/subtypes` request.
1653
+
1654
+ A request to resolve the subtypes for a given `TypeHierarchyItem`.
1655
+
1656
+ @since 3.17.0
1657
+ """
1658
+ if self.stopped:
1659
+ raise RuntimeError("Client has been stopped.")
1660
+
1661
+ return self.protocol.send_request("typeHierarchy/subtypes", params, callback)
1662
+
1663
+ async def type_hierarchy_subtypes_async(
1664
+ self,
1665
+ params: types.TypeHierarchySubtypesParams,
1666
+ ) -> Optional[List[types.TypeHierarchyItem]]:
1667
+ """Make a :lsp:`typeHierarchy/subtypes` request.
1668
+
1669
+ A request to resolve the subtypes for a given `TypeHierarchyItem`.
1670
+
1671
+ @since 3.17.0
1672
+ """
1673
+ if self.stopped:
1674
+ raise RuntimeError("Client has been stopped.")
1675
+
1676
+ return await self.protocol.send_request_async("typeHierarchy/subtypes", params)
1677
+
1678
+ def type_hierarchy_supertypes(
1679
+ self,
1680
+ params: types.TypeHierarchySupertypesParams,
1681
+ callback: Optional[
1682
+ Callable[[Optional[List[types.TypeHierarchyItem]]], None]
1683
+ ] = None,
1684
+ ) -> Future:
1685
+ """Make a :lsp:`typeHierarchy/supertypes` request.
1686
+
1687
+ A request to resolve the supertypes for a given `TypeHierarchyItem`.
1688
+
1689
+ @since 3.17.0
1690
+ """
1691
+ if self.stopped:
1692
+ raise RuntimeError("Client has been stopped.")
1693
+
1694
+ return self.protocol.send_request("typeHierarchy/supertypes", params, callback)
1695
+
1696
+ async def type_hierarchy_supertypes_async(
1697
+ self,
1698
+ params: types.TypeHierarchySupertypesParams,
1699
+ ) -> Optional[List[types.TypeHierarchyItem]]:
1700
+ """Make a :lsp:`typeHierarchy/supertypes` request.
1701
+
1702
+ A request to resolve the supertypes for a given `TypeHierarchyItem`.
1703
+
1704
+ @since 3.17.0
1705
+ """
1706
+ if self.stopped:
1707
+ raise RuntimeError("Client has been stopped.")
1708
+
1709
+ return await self.protocol.send_request_async(
1710
+ "typeHierarchy/supertypes", params
1711
+ )
1712
+
1713
+ def workspace_diagnostic(
1714
+ self,
1715
+ params: types.WorkspaceDiagnosticParams,
1716
+ callback: Optional[Callable[[types.WorkspaceDiagnosticReport], None]] = None,
1717
+ ) -> Future:
1718
+ """Make a :lsp:`workspace/diagnostic` request.
1719
+
1720
+ The workspace diagnostic request definition.
1721
+
1722
+ @since 3.17.0
1723
+ """
1724
+ if self.stopped:
1725
+ raise RuntimeError("Client has been stopped.")
1726
+
1727
+ return self.protocol.send_request("workspace/diagnostic", params, callback)
1728
+
1729
+ async def workspace_diagnostic_async(
1730
+ self,
1731
+ params: types.WorkspaceDiagnosticParams,
1732
+ ) -> types.WorkspaceDiagnosticReport:
1733
+ """Make a :lsp:`workspace/diagnostic` request.
1734
+
1735
+ The workspace diagnostic request definition.
1736
+
1737
+ @since 3.17.0
1738
+ """
1739
+ if self.stopped:
1740
+ raise RuntimeError("Client has been stopped.")
1741
+
1742
+ return await self.protocol.send_request_async("workspace/diagnostic", params)
1743
+
1744
+ def workspace_execute_command(
1745
+ self,
1746
+ params: types.ExecuteCommandParams,
1747
+ callback: Optional[Callable[[Optional[Any]], None]] = None,
1748
+ ) -> Future:
1749
+ """Make a :lsp:`workspace/executeCommand` request.
1750
+
1751
+ A request send from the client to the server to execute a command. The request might return
1752
+ a workspace edit which the client will apply to the workspace.
1753
+ """
1754
+ if self.stopped:
1755
+ raise RuntimeError("Client has been stopped.")
1756
+
1757
+ return self.protocol.send_request("workspace/executeCommand", params, callback)
1758
+
1759
+ async def workspace_execute_command_async(
1760
+ self,
1761
+ params: types.ExecuteCommandParams,
1762
+ ) -> Optional[Any]:
1763
+ """Make a :lsp:`workspace/executeCommand` request.
1764
+
1765
+ A request send from the client to the server to execute a command. The request might return
1766
+ a workspace edit which the client will apply to the workspace.
1767
+ """
1768
+ if self.stopped:
1769
+ raise RuntimeError("Client has been stopped.")
1770
+
1771
+ return await self.protocol.send_request_async(
1772
+ "workspace/executeCommand", params
1773
+ )
1774
+
1775
+ def workspace_symbol(
1776
+ self,
1777
+ params: types.WorkspaceSymbolParams,
1778
+ callback: Optional[
1779
+ Callable[
1780
+ [
1781
+ Union[
1782
+ List[types.SymbolInformation], List[types.WorkspaceSymbol], None
1783
+ ]
1784
+ ],
1785
+ None,
1786
+ ]
1787
+ ] = None,
1788
+ ) -> Future:
1789
+ """Make a :lsp:`workspace/symbol` request.
1790
+
1791
+ A request to list project-wide symbols matching the query string given
1792
+ by the {@link WorkspaceSymbolParams}. The response is
1793
+ of type {@link SymbolInformation SymbolInformation[]} or a Thenable that
1794
+ resolves to such.
1795
+
1796
+ @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients
1797
+ need to advertise support for WorkspaceSymbols via the client capability
1798
+ `workspace.symbol.resolveSupport`.
1799
+ """
1800
+ if self.stopped:
1801
+ raise RuntimeError("Client has been stopped.")
1802
+
1803
+ return self.protocol.send_request("workspace/symbol", params, callback)
1804
+
1805
+ async def workspace_symbol_async(
1806
+ self,
1807
+ params: types.WorkspaceSymbolParams,
1808
+ ) -> Union[List[types.SymbolInformation], List[types.WorkspaceSymbol], None]:
1809
+ """Make a :lsp:`workspace/symbol` request.
1810
+
1811
+ A request to list project-wide symbols matching the query string given
1812
+ by the {@link WorkspaceSymbolParams}. The response is
1813
+ of type {@link SymbolInformation SymbolInformation[]} or a Thenable that
1814
+ resolves to such.
1815
+
1816
+ @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients
1817
+ need to advertise support for WorkspaceSymbols via the client capability
1818
+ `workspace.symbol.resolveSupport`.
1819
+ """
1820
+ if self.stopped:
1821
+ raise RuntimeError("Client has been stopped.")
1822
+
1823
+ return await self.protocol.send_request_async("workspace/symbol", params)
1824
+
1825
+ def workspace_symbol_resolve(
1826
+ self,
1827
+ params: types.WorkspaceSymbol,
1828
+ callback: Optional[Callable[[types.WorkspaceSymbol], None]] = None,
1829
+ ) -> Future:
1830
+ """Make a :lsp:`workspaceSymbol/resolve` request.
1831
+
1832
+ A request to resolve the range inside the workspace
1833
+ symbol's location.
1834
+
1835
+ @since 3.17.0
1836
+ """
1837
+ if self.stopped:
1838
+ raise RuntimeError("Client has been stopped.")
1839
+
1840
+ return self.protocol.send_request("workspaceSymbol/resolve", params, callback)
1841
+
1842
+ async def workspace_symbol_resolve_async(
1843
+ self,
1844
+ params: types.WorkspaceSymbol,
1845
+ ) -> types.WorkspaceSymbol:
1846
+ """Make a :lsp:`workspaceSymbol/resolve` request.
1847
+
1848
+ A request to resolve the range inside the workspace
1849
+ symbol's location.
1850
+
1851
+ @since 3.17.0
1852
+ """
1853
+ if self.stopped:
1854
+ raise RuntimeError("Client has been stopped.")
1855
+
1856
+ return await self.protocol.send_request_async("workspaceSymbol/resolve", params)
1857
+
1858
+ def workspace_will_create_files(
1859
+ self,
1860
+ params: types.CreateFilesParams,
1861
+ callback: Optional[Callable[[Optional[types.WorkspaceEdit]], None]] = None,
1862
+ ) -> Future:
1863
+ """Make a :lsp:`workspace/willCreateFiles` request.
1864
+
1865
+ The will create files request is sent from the client to the server before files are actually
1866
+ created as long as the creation is triggered from within the client.
1867
+
1868
+ The request can return a `WorkspaceEdit` which will be applied to workspace before the
1869
+ files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file
1870
+ to be created.
1871
+
1872
+ @since 3.16.0
1873
+ """
1874
+ if self.stopped:
1875
+ raise RuntimeError("Client has been stopped.")
1876
+
1877
+ return self.protocol.send_request("workspace/willCreateFiles", params, callback)
1878
+
1879
+ async def workspace_will_create_files_async(
1880
+ self,
1881
+ params: types.CreateFilesParams,
1882
+ ) -> Optional[types.WorkspaceEdit]:
1883
+ """Make a :lsp:`workspace/willCreateFiles` request.
1884
+
1885
+ The will create files request is sent from the client to the server before files are actually
1886
+ created as long as the creation is triggered from within the client.
1887
+
1888
+ The request can return a `WorkspaceEdit` which will be applied to workspace before the
1889
+ files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file
1890
+ to be created.
1891
+
1892
+ @since 3.16.0
1893
+ """
1894
+ if self.stopped:
1895
+ raise RuntimeError("Client has been stopped.")
1896
+
1897
+ return await self.protocol.send_request_async(
1898
+ "workspace/willCreateFiles", params
1899
+ )
1900
+
1901
+ def workspace_will_delete_files(
1902
+ self,
1903
+ params: types.DeleteFilesParams,
1904
+ callback: Optional[Callable[[Optional[types.WorkspaceEdit]], None]] = None,
1905
+ ) -> Future:
1906
+ """Make a :lsp:`workspace/willDeleteFiles` request.
1907
+
1908
+ The did delete files notification is sent from the client to the server when
1909
+ files were deleted from within the client.
1910
+
1911
+ @since 3.16.0
1912
+ """
1913
+ if self.stopped:
1914
+ raise RuntimeError("Client has been stopped.")
1915
+
1916
+ return self.protocol.send_request("workspace/willDeleteFiles", params, callback)
1917
+
1918
+ async def workspace_will_delete_files_async(
1919
+ self,
1920
+ params: types.DeleteFilesParams,
1921
+ ) -> Optional[types.WorkspaceEdit]:
1922
+ """Make a :lsp:`workspace/willDeleteFiles` request.
1923
+
1924
+ The did delete files notification is sent from the client to the server when
1925
+ files were deleted from within the client.
1926
+
1927
+ @since 3.16.0
1928
+ """
1929
+ if self.stopped:
1930
+ raise RuntimeError("Client has been stopped.")
1931
+
1932
+ return await self.protocol.send_request_async(
1933
+ "workspace/willDeleteFiles", params
1934
+ )
1935
+
1936
+ def workspace_will_rename_files(
1937
+ self,
1938
+ params: types.RenameFilesParams,
1939
+ callback: Optional[Callable[[Optional[types.WorkspaceEdit]], None]] = None,
1940
+ ) -> Future:
1941
+ """Make a :lsp:`workspace/willRenameFiles` request.
1942
+
1943
+ The will rename files request is sent from the client to the server before files are actually
1944
+ renamed as long as the rename is triggered from within the client.
1945
+
1946
+ @since 3.16.0
1947
+ """
1948
+ if self.stopped:
1949
+ raise RuntimeError("Client has been stopped.")
1950
+
1951
+ return self.protocol.send_request("workspace/willRenameFiles", params, callback)
1952
+
1953
+ async def workspace_will_rename_files_async(
1954
+ self,
1955
+ params: types.RenameFilesParams,
1956
+ ) -> Optional[types.WorkspaceEdit]:
1957
+ """Make a :lsp:`workspace/willRenameFiles` request.
1958
+
1959
+ The will rename files request is sent from the client to the server before files are actually
1960
+ renamed as long as the rename is triggered from within the client.
1961
+
1962
+ @since 3.16.0
1963
+ """
1964
+ if self.stopped:
1965
+ raise RuntimeError("Client has been stopped.")
1966
+
1967
+ return await self.protocol.send_request_async(
1968
+ "workspace/willRenameFiles", params
1969
+ )
1970
+
1971
+ def cancel_request(self, params: types.CancelParams) -> None:
1972
+ """Send a :lsp:`$/cancelRequest` notification."""
1973
+ if self.stopped:
1974
+ raise RuntimeError("Client has been stopped.")
1975
+
1976
+ self.protocol.notify("$/cancelRequest", params)
1977
+
1978
+ def exit(self, params: None) -> None:
1979
+ """Send a :lsp:`exit` notification.
1980
+
1981
+ The exit event is sent from the client to the server to
1982
+ ask the server to exit its process.
1983
+ """
1984
+ if self.stopped:
1985
+ raise RuntimeError("Client has been stopped.")
1986
+
1987
+ self.protocol.notify("exit", params)
1988
+
1989
+ def initialized(self, params: types.InitializedParams) -> None:
1990
+ """Send a :lsp:`initialized` notification.
1991
+
1992
+ The initialized notification is sent from the client to the
1993
+ server after the client is fully initialized and the server
1994
+ is allowed to send requests from the server to the client.
1995
+ """
1996
+ if self.stopped:
1997
+ raise RuntimeError("Client has been stopped.")
1998
+
1999
+ self.protocol.notify("initialized", params)
2000
+
2001
+ def notebook_document_did_change(
2002
+ self, params: types.DidChangeNotebookDocumentParams
2003
+ ) -> None:
2004
+ """Send a :lsp:`notebookDocument/didChange` notification."""
2005
+ if self.stopped:
2006
+ raise RuntimeError("Client has been stopped.")
2007
+
2008
+ self.protocol.notify("notebookDocument/didChange", params)
2009
+
2010
+ def notebook_document_did_close(
2011
+ self, params: types.DidCloseNotebookDocumentParams
2012
+ ) -> None:
2013
+ """Send a :lsp:`notebookDocument/didClose` notification.
2014
+
2015
+ A notification sent when a notebook closes.
2016
+
2017
+ @since 3.17.0
2018
+ """
2019
+ if self.stopped:
2020
+ raise RuntimeError("Client has been stopped.")
2021
+
2022
+ self.protocol.notify("notebookDocument/didClose", params)
2023
+
2024
+ def notebook_document_did_open(
2025
+ self, params: types.DidOpenNotebookDocumentParams
2026
+ ) -> None:
2027
+ """Send a :lsp:`notebookDocument/didOpen` notification.
2028
+
2029
+ A notification sent when a notebook opens.
2030
+
2031
+ @since 3.17.0
2032
+ """
2033
+ if self.stopped:
2034
+ raise RuntimeError("Client has been stopped.")
2035
+
2036
+ self.protocol.notify("notebookDocument/didOpen", params)
2037
+
2038
+ def notebook_document_did_save(
2039
+ self, params: types.DidSaveNotebookDocumentParams
2040
+ ) -> None:
2041
+ """Send a :lsp:`notebookDocument/didSave` notification.
2042
+
2043
+ A notification sent when a notebook document is saved.
2044
+
2045
+ @since 3.17.0
2046
+ """
2047
+ if self.stopped:
2048
+ raise RuntimeError("Client has been stopped.")
2049
+
2050
+ self.protocol.notify("notebookDocument/didSave", params)
2051
+
2052
+ def progress(self, params: types.ProgressParams) -> None:
2053
+ """Send a :lsp:`$/progress` notification."""
2054
+ if self.stopped:
2055
+ raise RuntimeError("Client has been stopped.")
2056
+
2057
+ self.protocol.notify("$/progress", params)
2058
+
2059
+ def set_trace(self, params: types.SetTraceParams) -> None:
2060
+ """Send a :lsp:`$/setTrace` notification."""
2061
+ if self.stopped:
2062
+ raise RuntimeError("Client has been stopped.")
2063
+
2064
+ self.protocol.notify("$/setTrace", params)
2065
+
2066
+ def text_document_did_change(
2067
+ self, params: types.DidChangeTextDocumentParams
2068
+ ) -> None:
2069
+ """Send a :lsp:`textDocument/didChange` notification.
2070
+
2071
+ The document change notification is sent from the client to the server to signal
2072
+ changes to a text document.
2073
+ """
2074
+ if self.stopped:
2075
+ raise RuntimeError("Client has been stopped.")
2076
+
2077
+ self.protocol.notify("textDocument/didChange", params)
2078
+
2079
+ def text_document_did_close(self, params: types.DidCloseTextDocumentParams) -> None:
2080
+ """Send a :lsp:`textDocument/didClose` notification.
2081
+
2082
+ The document close notification is sent from the client to the server when
2083
+ the document got closed in the client. The document's truth now exists where
2084
+ the document's uri points to (e.g. if the document's uri is a file uri the
2085
+ truth now exists on disk). As with the open notification the close notification
2086
+ is about managing the document's content. Receiving a close notification
2087
+ doesn't mean that the document was open in an editor before. A close
2088
+ notification requires a previous open notification to be sent.
2089
+ """
2090
+ if self.stopped:
2091
+ raise RuntimeError("Client has been stopped.")
2092
+
2093
+ self.protocol.notify("textDocument/didClose", params)
2094
+
2095
+ def text_document_did_open(self, params: types.DidOpenTextDocumentParams) -> None:
2096
+ """Send a :lsp:`textDocument/didOpen` notification.
2097
+
2098
+ The document open notification is sent from the client to the server to signal
2099
+ newly opened text documents. The document's truth is now managed by the client
2100
+ and the server must not try to read the document's truth using the document's
2101
+ uri. Open in this sense means it is managed by the client. It doesn't necessarily
2102
+ mean that its content is presented in an editor. An open notification must not
2103
+ be sent more than once without a corresponding close notification send before.
2104
+ This means open and close notification must be balanced and the max open count
2105
+ is one.
2106
+ """
2107
+ if self.stopped:
2108
+ raise RuntimeError("Client has been stopped.")
2109
+
2110
+ self.protocol.notify("textDocument/didOpen", params)
2111
+
2112
+ def text_document_did_save(self, params: types.DidSaveTextDocumentParams) -> None:
2113
+ """Send a :lsp:`textDocument/didSave` notification.
2114
+
2115
+ The document save notification is sent from the client to the server when
2116
+ the document got saved in the client.
2117
+ """
2118
+ if self.stopped:
2119
+ raise RuntimeError("Client has been stopped.")
2120
+
2121
+ self.protocol.notify("textDocument/didSave", params)
2122
+
2123
+ def text_document_will_save(self, params: types.WillSaveTextDocumentParams) -> None:
2124
+ """Send a :lsp:`textDocument/willSave` notification.
2125
+
2126
+ A document will save notification is sent from the client to the server before
2127
+ the document is actually saved.
2128
+ """
2129
+ if self.stopped:
2130
+ raise RuntimeError("Client has been stopped.")
2131
+
2132
+ self.protocol.notify("textDocument/willSave", params)
2133
+
2134
+ def window_work_done_progress_cancel(
2135
+ self, params: types.WorkDoneProgressCancelParams
2136
+ ) -> None:
2137
+ """Send a :lsp:`window/workDoneProgress/cancel` notification.
2138
+
2139
+ The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress
2140
+ initiated on the server side.
2141
+ """
2142
+ if self.stopped:
2143
+ raise RuntimeError("Client has been stopped.")
2144
+
2145
+ self.protocol.notify("window/workDoneProgress/cancel", params)
2146
+
2147
+ def workspace_did_change_configuration(
2148
+ self, params: types.DidChangeConfigurationParams
2149
+ ) -> None:
2150
+ """Send a :lsp:`workspace/didChangeConfiguration` notification.
2151
+
2152
+ The configuration change notification is sent from the client to the server
2153
+ when the client's configuration has changed. The notification contains
2154
+ the changed configuration as defined by the language client.
2155
+ """
2156
+ if self.stopped:
2157
+ raise RuntimeError("Client has been stopped.")
2158
+
2159
+ self.protocol.notify("workspace/didChangeConfiguration", params)
2160
+
2161
+ def workspace_did_change_watched_files(
2162
+ self, params: types.DidChangeWatchedFilesParams
2163
+ ) -> None:
2164
+ """Send a :lsp:`workspace/didChangeWatchedFiles` notification.
2165
+
2166
+ The watched files notification is sent from the client to the server when
2167
+ the client detects changes to file watched by the language client.
2168
+ """
2169
+ if self.stopped:
2170
+ raise RuntimeError("Client has been stopped.")
2171
+
2172
+ self.protocol.notify("workspace/didChangeWatchedFiles", params)
2173
+
2174
+ def workspace_did_change_workspace_folders(
2175
+ self, params: types.DidChangeWorkspaceFoldersParams
2176
+ ) -> None:
2177
+ """Send a :lsp:`workspace/didChangeWorkspaceFolders` notification.
2178
+
2179
+ The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
2180
+ folder configuration changes.
2181
+ """
2182
+ if self.stopped:
2183
+ raise RuntimeError("Client has been stopped.")
2184
+
2185
+ self.protocol.notify("workspace/didChangeWorkspaceFolders", params)
2186
+
2187
+ def workspace_did_create_files(self, params: types.CreateFilesParams) -> None:
2188
+ """Send a :lsp:`workspace/didCreateFiles` notification.
2189
+
2190
+ The did create files notification is sent from the client to the server when
2191
+ files were created from within the client.
2192
+
2193
+ @since 3.16.0
2194
+ """
2195
+ if self.stopped:
2196
+ raise RuntimeError("Client has been stopped.")
2197
+
2198
+ self.protocol.notify("workspace/didCreateFiles", params)
2199
+
2200
+ def workspace_did_delete_files(self, params: types.DeleteFilesParams) -> None:
2201
+ """Send a :lsp:`workspace/didDeleteFiles` notification.
2202
+
2203
+ The will delete files request is sent from the client to the server before files are actually
2204
+ deleted as long as the deletion is triggered from within the client.
2205
+
2206
+ @since 3.16.0
2207
+ """
2208
+ if self.stopped:
2209
+ raise RuntimeError("Client has been stopped.")
2210
+
2211
+ self.protocol.notify("workspace/didDeleteFiles", params)
2212
+
2213
+ def workspace_did_rename_files(self, params: types.RenameFilesParams) -> None:
2214
+ """Send a :lsp:`workspace/didRenameFiles` notification.
2215
+
2216
+ The did rename files notification is sent from the client to the server when
2217
+ files were renamed from within the client.
2218
+
2219
+ @since 3.16.0
2220
+ """
2221
+ if self.stopped:
2222
+ raise RuntimeError("Client has been stopped.")
2223
+
2224
+ self.protocol.notify("workspace/didRenameFiles", params)