-
Notifications
You must be signed in to change notification settings - Fork 1
/
lsp_types.py
6174 lines (4781 loc) · 232 KB
/
lsp_types.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Code generated. DO NOT EDIT.
# LSP v3.17.0
from typing_extensions import NotRequired
from typing import Dict, List, Literal, TypedDict, Union
from enum import IntEnum, IntFlag, StrEnum
URI = str
DocumentUri = str
Uint = int
RegExp = str
class SemanticTokenTypes(StrEnum):
""" A set of predefined token types. This set is not fixed
an clients can specify additional token types via the
corresponding client capabilities.
@since 3.16.0 """
Namespace = 'namespace'
Type = 'type'
""" Represents a generic type. Acts as a fallback for types which can't be mapped to
a specific type like class or enum. """
Class = 'class'
Enum = 'enum'
Interface = 'interface'
Struct = 'struct'
TypeParameter = 'typeParameter'
Parameter = 'parameter'
Variable = 'variable'
Property = 'property'
EnumMember = 'enumMember'
Event = 'event'
Function = 'function'
Method = 'method'
Macro = 'macro'
Keyword = 'keyword'
Modifier = 'modifier'
Comment = 'comment'
String = 'string'
Number = 'number'
Regexp = 'regexp'
Operator = 'operator'
Decorator = 'decorator'
""" @since 3.17.0 """
Label = 'label'
""" @since 3.18.0 """
class SemanticTokenModifiers(StrEnum):
""" A set of predefined token modifiers. This set is not fixed
an clients can specify additional token types via the
corresponding client capabilities.
@since 3.16.0 """
Declaration = 'declaration'
Definition = 'definition'
Readonly = 'readonly'
Static = 'static'
Deprecated = 'deprecated'
Abstract = 'abstract'
Async = 'async'
Modification = 'modification'
Documentation = 'documentation'
DefaultLibrary = 'defaultLibrary'
class DocumentDiagnosticReportKind(StrEnum):
""" The document diagnostic report kinds.
@since 3.17.0 """
Full = 'full'
""" A diagnostic report with a full
set of problems. """
Unchanged = 'unchanged'
""" A report indicating that the last
returned report is still accurate. """
class ErrorCodes(IntEnum):
""" Predefined error codes. """
ParseError = -32700
InvalidRequest = -32600
MethodNotFound = -32601
InvalidParams = -32602
InternalError = -32603
ServerNotInitialized = -32002
""" Error code indicating that a server received a notification or
request before the server has received the `initialize` request. """
UnknownErrorCode = -32001
class LSPErrorCodes(IntEnum):
RequestFailed = -32803
""" A request failed but it was syntactically correct, e.g the
method name was known and the parameters were valid. The error
message should contain human readable information about why
the request failed.
@since 3.17.0 """
ServerCancelled = -32802
""" The server cancelled the request. This error code should
only be used for requests that explicitly support being
server cancellable.
@since 3.17.0 """
ContentModified = -32801
""" The server detected that the content of a document got
modified outside normal conditions. A server should
NOT send this error code if it detects a content change
in it unprocessed messages. The result even computed
on an older state might still be useful for the client.
If a client decides that a result is not of any use anymore
the client should cancel the request. """
RequestCancelled = -32800
""" The client has canceled a request and a server has detected
the cancel. """
class FoldingRangeKind(StrEnum):
""" A set of predefined range kinds. """
Comment = 'comment'
""" Folding range for a comment """
Imports = 'imports'
""" Folding range for an import or include """
Region = 'region'
""" Folding range for a region (e.g. `#region`) """
class SymbolKind(IntEnum):
""" A symbol kind. """
File = 1
Module = 2
Namespace = 3
Package = 4
Class = 5
Method = 6
Property = 7
Field = 8
Constructor = 9
Enum = 10
Interface = 11
Function = 12
Variable = 13
Constant = 14
String = 15
Number = 16
Boolean = 17
Array = 18
Object = 19
Key = 20
Null = 21
EnumMember = 22
Struct = 23
Event = 24
Operator = 25
TypeParameter = 26
class SymbolTag(IntEnum):
""" Symbol tags are extra annotations that tweak the rendering of a symbol.
@since 3.16 """
Deprecated = 1
""" Render a symbol as obsolete, usually using a strike-out. """
class UniquenessLevel(StrEnum):
""" Moniker uniqueness level to define scope of the moniker.
@since 3.16.0 """
Document = 'document'
""" The moniker is only unique inside a document """
Project = 'project'
""" The moniker is unique inside a project for which a dump got created """
Group = 'group'
""" The moniker is unique inside the group to which a project belongs """
Scheme = 'scheme'
""" The moniker is unique inside the moniker scheme. """
Global = 'global'
""" The moniker is globally unique """
class MonikerKind(StrEnum):
""" The moniker kind.
@since 3.16.0 """
Import = 'import'
""" The moniker represent a symbol that is imported into a project """
Export = 'export'
""" The moniker represents a symbol that is exported from a project """
Local = 'local'
""" The moniker represents a symbol that is local to a project (e.g. a local
variable of a function, a class not visible outside the project, ...) """
class InlayHintKind(IntEnum):
""" Inlay hint kinds.
@since 3.17.0 """
Type = 1
""" An inlay hint that for a type annotation. """
Parameter = 2
""" An inlay hint that is for a parameter. """
class MessageType(IntEnum):
""" The message type """
Error = 1
""" An error message. """
Warning = 2
""" A warning message. """
Info = 3
""" An information message. """
Log = 4
""" A log message. """
Debug = 5
""" A debug message.
@since 3.18.0
@proposed """
class TextDocumentSyncKind(IntEnum):
""" Defines how the host (editor) should sync
document changes to the language server. """
None_ = 0
""" Documents should not be synced at all. """
Full = 1
""" Documents are synced by always sending the full content
of the document. """
Incremental = 2
""" Documents are synced by sending the full content on open.
After that only incremental updates to the document are
send. """
class TextDocumentSaveReason(IntEnum):
""" Represents reasons why a text document is saved. """
Manual = 1
""" Manually triggered, e.g. by the user pressing save, by starting debugging,
or by an API call. """
AfterDelay = 2
""" Automatic after a delay. """
FocusOut = 3
""" When the editor lost focus. """
class CompletionItemKind(IntEnum):
""" The kind of a completion entry. """
Text = 1
Method = 2
Function = 3
Constructor = 4
Field = 5
Variable = 6
Class = 7
Interface = 8
Module = 9
Property = 10
Unit = 11
Value = 12
Enum = 13
Keyword = 14
Snippet = 15
Color = 16
File = 17
Reference = 18
Folder = 19
EnumMember = 20
Constant = 21
Struct = 22
Event = 23
Operator = 24
TypeParameter = 25
class CompletionItemTag(IntEnum):
""" Completion item tags are extra annotations that tweak the rendering of a completion
item.
@since 3.15.0 """
Deprecated = 1
""" Render a completion as obsolete, usually using a strike-out. """
class InsertTextFormat(IntEnum):
""" Defines whether the insert text in a completion item should be interpreted as
plain text or a snippet. """
PlainText = 1
""" The primary text to be inserted is treated as a plain string. """
Snippet = 2
""" The primary text to be inserted is treated as a snippet.
A snippet can define tab stops and placeholders with `$1`, `$2`
and `${3:foo}`. `$0` defines the final tab stop, it defaults to
the end of the snippet. Placeholders with equal identifiers are linked,
that is typing in one will update others too.
See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax """
class InsertTextMode(IntEnum):
""" How whitespace and indentation is handled during completion
item insertion.
@since 3.16.0 """
AsIs = 1
""" The insertion or replace strings is taken as it is. If the
value is multi line the lines below the cursor will be
inserted using the indentation defined in the string value.
The client will not apply any kind of adjustments to the
string. """
AdjustIndentation = 2
""" The editor adjusts leading whitespace of new lines so that
they match the indentation up to the cursor of the line for
which the item is accepted.
Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
multi line completion item is indented using 2 tabs and all
following lines inserted will be indented using 2 tabs as well. """
class DocumentHighlightKind(IntEnum):
""" A document highlight kind. """
Text = 1
""" A textual occurrence. """
Read = 2
""" Read-access of a symbol, like reading a variable. """
Write = 3
""" Write-access of a symbol, like writing to a variable. """
class CodeActionKind(StrEnum):
""" A set of predefined code action kinds """
Empty = ''
""" Empty kind. """
QuickFix = 'quickfix'
""" Base kind for quickfix actions: 'quickfix' """
Refactor = 'refactor'
""" Base kind for refactoring actions: 'refactor' """
RefactorExtract = 'refactor.extract'
""" Base kind for refactoring extraction actions: 'refactor.extract'
Example extract actions:
- Extract method
- Extract function
- Extract variable
- Extract interface from class
- ... """
RefactorInline = 'refactor.inline'
""" Base kind for refactoring inline actions: 'refactor.inline'
Example inline actions:
- Inline function
- Inline variable
- Inline constant
- ... """
RefactorMove = 'refactor.move'
""" Base kind for refactoring move actions: `refactor.move`
Example move actions:
- Move a function to a new file
- Move a property between classes
- Move method to base class
- ...
@since 3.18.0
@proposed """
RefactorRewrite = 'refactor.rewrite'
""" Base kind for refactoring rewrite actions: 'refactor.rewrite'
Example rewrite actions:
- Convert JavaScript function to class
- Add or remove parameter
- Encapsulate field
- Make method static
- Move method to base class
- ... """
Source = 'source'
""" Base kind for source actions: `source`
Source code actions apply to the entire file. """
SourceOrganizeImports = 'source.organizeImports'
""" Base kind for an organize imports source action: `source.organizeImports` """
SourceFixAll = 'source.fixAll'
""" Base kind for auto-fix source actions: `source.fixAll`.
Fix all actions automatically fix errors that have a clear fix that do not require user input.
They should not suppress errors or perform unsafe fixes such as generating new types or classes.
@since 3.15.0 """
Notebook = 'notebook'
""" Base kind for all code actions applying to the entire notebook's scope. CodeActionKinds using
this should always begin with `notebook.`
@since 3.18.0 """
class CodeActionTag(IntEnum):
""" Code action tags are extra annotations that tweak the behavior of a code action.
@since 3.18.0 - proposed """
LLMGenerated = 1
""" Marks the code action as LLM-generated. """
class TraceValue(StrEnum):
Off = 'off'
""" Turn tracing off. """
Messages = 'messages'
""" Trace messages only. """
Verbose = 'verbose'
""" Verbose message tracing. """
class MarkupKind(StrEnum):
""" Describes the content type that a client supports in various
result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
Please note that `MarkupKinds` must not start with a `$`. This kinds
are reserved for internal usage. """
PlainText = 'plaintext'
""" Plain text is supported as a content format """
Markdown = 'markdown'
""" Markdown is supported as a content format """
class LanguageKind(StrEnum):
""" Predefined Language kinds
@since 3.18.0
@proposed """
ABAP = 'abap'
WindowsBat = 'bat'
BibTeX = 'bibtex'
Clojure = 'clojure'
Coffeescript = 'coffeescript'
C = 'c'
CPP = 'cpp'
CSharp = 'csharp'
CSS = 'css'
D = 'd'
""" @since 3.18.0
@proposed """
Delphi = 'pascal'
""" @since 3.18.0
@proposed """
Diff = 'diff'
Dart = 'dart'
Dockerfile = 'dockerfile'
Elixir = 'elixir'
Erlang = 'erlang'
FSharp = 'fsharp'
GitCommit = 'git-commit'
GitRebase = 'rebase'
Go = 'go'
Groovy = 'groovy'
Handlebars = 'handlebars'
Haskell = 'haskell'
HTML = 'html'
Ini = 'ini'
Java = 'java'
JavaScript = 'javascript'
JavaScriptReact = 'javascriptreact'
JSON = 'json'
LaTeX = 'latex'
Less = 'less'
Lua = 'lua'
Makefile = 'makefile'
Markdown = 'markdown'
ObjectiveC = 'objective-c'
ObjectiveCPP = 'objective-cpp'
Pascal = 'pascal'
""" @since 3.18.0
@proposed """
Perl = 'perl'
Perl6 = 'perl6'
PHP = 'php'
Powershell = 'powershell'
Pug = 'jade'
Python = 'python'
R = 'r'
Razor = 'razor'
Ruby = 'ruby'
Rust = 'rust'
SCSS = 'scss'
SASS = 'sass'
Scala = 'scala'
ShaderLab = 'shaderlab'
ShellScript = 'shellscript'
SQL = 'sql'
Swift = 'swift'
TypeScript = 'typescript'
TypeScriptReact = 'typescriptreact'
TeX = 'tex'
VisualBasic = 'vb'
XML = 'xml'
XSL = 'xsl'
YAML = 'yaml'
class InlineCompletionTriggerKind(IntEnum):
""" Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
@since 3.18.0
@proposed """
Invoked = 1
""" Completion was triggered explicitly by a user gesture. """
Automatic = 2
""" Completion was triggered automatically while editing. """
class PositionEncodingKind(StrEnum):
""" A set of predefined position encoding kinds.
@since 3.17.0 """
UTF8 = 'utf-8'
""" Character offsets count UTF-8 code units (e.g. bytes). """
UTF16 = 'utf-16'
""" Character offsets count UTF-16 code units.
This is the default and must always be supported
by servers """
UTF32 = 'utf-32'
""" Character offsets count UTF-32 code units.
Implementation note: these are the same as Unicode codepoints,
so this `PositionEncodingKind` may also be used for an
encoding-agnostic representation of character offsets. """
class FileChangeType(IntEnum):
""" The file event type """
Created = 1
""" The file got created. """
Changed = 2
""" The file got changed. """
Deleted = 3
""" The file got deleted. """
class WatchKind(IntFlag):
Create = 1
""" Interested in create events. """
Change = 2
""" Interested in change events """
Delete = 4
""" Interested in delete events """
class DiagnosticSeverity(IntEnum):
""" The diagnostic's severity. """
Error = 1
""" Reports an error. """
Warning = 2
""" Reports a warning. """
Information = 3
""" Reports an information. """
Hint = 4
""" Reports a hint. """
class DiagnosticTag(IntEnum):
""" The diagnostic tags.
@since 3.15.0 """
Unnecessary = 1
""" Unused or unnecessary code.
Clients are allowed to render diagnostics with this tag faded out instead of having
an error squiggle. """
Deprecated = 2
""" Deprecated or obsolete code.
Clients are allowed to rendered diagnostics with this tag strike through. """
class CompletionTriggerKind(IntEnum):
""" How a completion was triggered """
Invoked = 1
""" Completion was triggered by typing an identifier (24x7 code
complete), manual invocation (e.g Ctrl+Space) or via API. """
TriggerCharacter = 2
""" Completion was triggered by a trigger character specified by
the `triggerCharacters` properties of the `CompletionRegistrationOptions`. """
TriggerForIncompleteCompletions = 3
""" Completion was re-triggered as current completion list is incomplete """
class ApplyKind(StrEnum):
""" Defines how values from a set of defaults and an individual item will be
merged.
@since 3.18.0 """
Replace = 'replace'
""" The value from the individual item (if provided and not `null`) will be
used instead of the default. """
Merge = 'merge'
""" The value from the item will be merged with the default.
The specific rules for mergeing values are defined against each field
that supports merging. """
class SignatureHelpTriggerKind(IntEnum):
""" How a signature help was triggered.
@since 3.15.0 """
Invoked = 1
""" Signature help was invoked manually by the user or by a command. """
TriggerCharacter = 2
""" Signature help was triggered by a trigger character. """
ContentChange = 3
""" Signature help was triggered by the cursor moving or by the document content changing. """
class CodeActionTriggerKind(IntEnum):
""" The reason why code actions were requested.
@since 3.17.0 """
Invoked = 1
""" Code actions were explicitly requested by the user or by an extension. """
Automatic = 2
""" Code actions were requested automatically.
This typically happens when current selection in a file changes, but can
also be triggered when file content changes. """
class FileOperationPatternKind(StrEnum):
""" A pattern kind describing if a glob pattern matches a file a folder or
both.
@since 3.16.0 """
File = 'file'
""" The pattern matches a file only. """
Folder = 'folder'
""" The pattern matches a folder only. """
class NotebookCellKind(IntEnum):
""" A notebook cell kind.
@since 3.17.0 """
Markup = 1
""" A markup-cell is formatted source that is used for display. """
Code = 2
""" A code-cell is source code. """
class ResourceOperationKind(StrEnum):
Create = 'create'
""" Supports creating new files and folders. """
Rename = 'rename'
""" Supports renaming existing files and folders. """
Delete = 'delete'
""" Supports deleting existing files and folders. """
class FailureHandlingKind(StrEnum):
Abort = 'abort'
""" Applying the workspace change is simply aborted if one of the changes provided
fails. All operations executed before the failing operation stay executed. """
Transactional = 'transactional'
""" All operations are executed transactional. That means they either all
succeed or no changes at all are applied to the workspace. """
TextOnlyTransactional = 'textOnlyTransactional'
""" If the workspace edit contains only textual file changes they are executed transactional.
If resource changes (create, rename or delete file) are part of the change the failure
handling strategy is abort. """
Undo = 'undo'
""" The client tries to undo the operations already executed. But there is no
guarantee that this is succeeding. """
class PrepareSupportDefaultBehavior(IntEnum):
Identifier = 1
""" The client's default behavior is to select the identifier
according the to language's syntax rule. """
class TokenFormat(StrEnum):
Relative = 'relative'
Definition = Union['Location', List['Location']]
""" The definition of a symbol represented as one or many {@link Location locations}.
For most programming languages there is only one location at which a symbol is
defined.
Servers should prefer returning `DefinitionLink` over `Definition` if supported
by the client. """
DefinitionLink = 'LocationLink'
""" Information about where a symbol is defined.
Provides additional metadata over normal {@link Location location} definitions, including the range of
the defining symbol """
LSPArray = List['LSPAny']
""" LSP arrays.
@since 3.17.0 """
LSPAny = Union['LSPObject', 'LSPArray', str, int, Uint, float, bool, None]
""" The LSP any type.
Please note that strictly speaking a property with the value `undefined`
can't be converted into JSON preserving the property name. However for
convenience it is allowed and assumed that all these properties are
optional as well.
@since 3.17.0 """
Declaration = Union['Location', List['Location']]
""" The declaration of a symbol representation as one or many {@link Location locations}. """
DeclarationLink = 'LocationLink'
""" Information about where a symbol is declared.
Provides additional metadata over normal {@link Location location} declarations, including the range of
the declaring symbol.
Servers should prefer returning `DeclarationLink` over `Declaration` if supported
by the client. """
InlineValue = Union['InlineValueText', 'InlineValueVariableLookup', 'InlineValueEvaluatableExpression']
""" Inline value information can be provided by different means:
- directly as a text value (class InlineValueText).
- as a name to use for a variable lookup (class InlineValueVariableLookup)
- as an evaluatable expression (class InlineValueEvaluatableExpression)
The InlineValue types combines all inline value types into one type.
@since 3.17.0 """
DocumentDiagnosticReport = Union['RelatedFullDocumentDiagnosticReport', 'RelatedUnchangedDocumentDiagnosticReport']
""" The result of a document diagnostic pull request. A report can
either be a full report containing all diagnostics for the
requested document or an unchanged report indicating that nothing
has changed in terms of diagnostics in comparison to the last
pull request.
@since 3.17.0 """
PrepareRenameResult = Union['Range', 'PrepareRenamePlaceholder', 'PrepareRenameDefaultBehavior']
DocumentSelector = List['DocumentFilter']
""" A document selector is the combination of one or many document filters.
@sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`;
The use of a string as a document filter is deprecated @since 3.16.0. """
ProgressToken = Union[int, str]
ChangeAnnotationIdentifier = str
""" An identifier to refer to a change annotation stored with a workspace edit. """
WorkspaceDocumentDiagnosticReport = Union['WorkspaceFullDocumentDiagnosticReport', 'WorkspaceUnchangedDocumentDiagnosticReport']
""" A workspace diagnostic document report.
@since 3.17.0 """
TextDocumentContentChangeEvent = Union['TextDocumentContentChangePartial', 'TextDocumentContentChangeWholeDocument']
""" An event describing a change to a text document. If only a text is provided
it is considered to be the full content of the document. """
MarkedString = Union[str, 'MarkedStringWithLanguage']
""" MarkedString can be used to render human readable text. It is either a markdown string
or a code-block that provides a language and a code snippet. The language identifier
is semantically equal to the optional language identifier in fenced code blocks in GitHub
issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
The pair of a language and a value is an equivalent to markdown:
```${language}
${value}
```
Note that markdown strings will be sanitized - that means html will be escaped.
@deprecated use MarkupContent instead. """
DocumentFilter = Union['TextDocumentFilter', 'NotebookCellTextDocumentFilter']
""" A document filter describes a top level text document or
a notebook cell document.
@since 3.17.0 - proposed support for NotebookCellTextDocumentFilter. """
LSPObject = Dict[str, 'LSPAny']
""" LSP object definition.
@since 3.17.0 """
GlobPattern = Union['Pattern', 'RelativePattern']
""" The glob pattern. Either a string pattern or a relative pattern.
@since 3.17.0 """
TextDocumentFilter = Union['TextDocumentFilterLanguage', 'TextDocumentFilterScheme', 'TextDocumentFilterPattern']
""" A document filter denotes a document by different properties like
the {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of
its resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}.
Glob patterns can have the following syntax:
- `*` to match one or more characters in a path segment
- `?` to match on one character in a path segment
- `**` to match any number of path segments, including none
- `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`
@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`
@since 3.17.0 """
NotebookDocumentFilter = Union['NotebookDocumentFilterNotebookType', 'NotebookDocumentFilterScheme', 'NotebookDocumentFilterPattern']
""" A notebook document filter denotes a notebook document by
different properties. The properties will be match
against the notebook's URI (same as with documents)
@since 3.17.0 """
Pattern = str
""" The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:
- `*` to match one or more characters in a path segment
- `?` to match on one character in a path segment
- `**` to match any number of path segments, including none
- `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
@since 3.17.0 """
RegularExpressionEngineKind = str
class ImplementationParams(TypedDict):
textDocument: 'TextDocumentIdentifier'
""" The text document. """
position: 'Position'
""" The position inside the text document. """
workDoneToken: NotRequired['ProgressToken']
""" An optional token that a server can use to report work done progress. """
partialResultToken: NotRequired['ProgressToken']
""" An optional token that a server can use to report partial results (e.g. streaming) to
the client. """
class Location(TypedDict):
""" Represents a location inside a resource, such as a line
inside a text file. """
uri: 'DocumentUri'
range: 'Range'
class ImplementationRegistrationOptions(TypedDict):
documentSelector: Union['DocumentSelector', None]
""" A document selector to identify the scope of the registration. If set to null
the document selector provided on the client side will be used. """
id: NotRequired[str]
""" The id used to register the request. The id can be used to deregister
the request again. See also Registration#id. """
class TypeDefinitionParams(TypedDict):
textDocument: 'TextDocumentIdentifier'
""" The text document. """
position: 'Position'
""" The position inside the text document. """
workDoneToken: NotRequired['ProgressToken']
""" An optional token that a server can use to report work done progress. """
partialResultToken: NotRequired['ProgressToken']
""" An optional token that a server can use to report partial results (e.g. streaming) to
the client. """
class TypeDefinitionRegistrationOptions(TypedDict):
documentSelector: Union['DocumentSelector', None]
""" A document selector to identify the scope of the registration. If set to null
the document selector provided on the client side will be used. """
id: NotRequired[str]
""" The id used to register the request. The id can be used to deregister
the request again. See also Registration#id. """
class WorkspaceFolder(TypedDict):
""" A workspace folder inside a client. """
uri: 'URI'
""" The associated URI for this workspace folder. """
name: str
""" The name of the workspace folder. Used to refer to this
workspace folder in the user interface. """
class DidChangeWorkspaceFoldersParams(TypedDict):
""" The parameters of a `workspace/didChangeWorkspaceFolders` notification. """
event: 'WorkspaceFoldersChangeEvent'
""" The actual workspace folder change event. """
class ConfigurationParams(TypedDict):
""" The parameters of a configuration request. """
items: List['ConfigurationItem']
class DocumentColorParams(TypedDict):
""" Parameters for a {@link DocumentColorRequest}. """
textDocument: 'TextDocumentIdentifier'
""" The text document. """
workDoneToken: NotRequired['ProgressToken']
""" An optional token that a server can use to report work done progress. """
partialResultToken: NotRequired['ProgressToken']
""" An optional token that a server can use to report partial results (e.g. streaming) to
the client. """
class ColorInformation(TypedDict):
""" Represents a color range from a document. """
range: 'Range'
""" The range in the document where this color appears. """
color: 'Color'
""" The actual color value for this color range. """
class DocumentColorRegistrationOptions(TypedDict):
documentSelector: Union['DocumentSelector', None]
""" A document selector to identify the scope of the registration. If set to null
the document selector provided on the client side will be used. """
id: NotRequired[str]
""" The id used to register the request. The id can be used to deregister
the request again. See also Registration#id. """
class ColorPresentationParams(TypedDict):
""" Parameters for a {@link ColorPresentationRequest}. """
textDocument: 'TextDocumentIdentifier'
""" The text document. """
color: 'Color'
""" The color to request presentations for. """
range: 'Range'
""" The range where the color would be inserted. Serves as a context. """
workDoneToken: NotRequired['ProgressToken']
""" An optional token that a server can use to report work done progress. """
partialResultToken: NotRequired['ProgressToken']
""" An optional token that a server can use to report partial results (e.g. streaming) to
the client. """
class ColorPresentation(TypedDict):
label: str
""" The label of this color presentation. It will be shown on the color
picker header. By default this is also the text that is inserted when selecting
this color presentation. """
textEdit: NotRequired['TextEdit']
""" An {@link TextEdit edit} which is applied to a document when selecting
this presentation for the color. When `falsy` the {@link ColorPresentation.label label}
is used. """
additionalTextEdits: NotRequired[List['TextEdit']]
""" An optional array of additional {@link TextEdit text edits} that are applied when
selecting this color presentation. Edits must not overlap with the main {@link ColorPresentation.textEdit edit} nor with themselves. """
class WorkDoneProgressOptions(TypedDict):
workDoneProgress: NotRequired[bool]
class TextDocumentRegistrationOptions(TypedDict):
""" General text document registration options. """
documentSelector: Union['DocumentSelector', None]
""" A document selector to identify the scope of the registration. If set to null
the document selector provided on the client side will be used. """
class FoldingRangeParams(TypedDict):
""" Parameters for a {@link FoldingRangeRequest}. """
textDocument: 'TextDocumentIdentifier'
""" The text document. """
workDoneToken: NotRequired['ProgressToken']
""" An optional token that a server can use to report work done progress. """
partialResultToken: NotRequired['ProgressToken']
""" An optional token that a server can use to report partial results (e.g. streaming) to
the client. """
class FoldingRange(TypedDict):
""" Represents a folding range. To be valid, start and end line must be bigger than zero and smaller
than the number of lines in the document. Clients are free to ignore invalid ranges. """
startLine: Uint
""" The zero-based start line of the range to fold. The folded area starts after the line's last character.
To be valid, the end must be zero or larger and smaller than the number of lines in the document. """
startCharacter: NotRequired[Uint]
""" The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line. """
endLine: Uint
""" The zero-based end line of the range to fold. The folded area ends with the line's last character.
To be valid, the end must be zero or larger and smaller than the number of lines in the document. """
endCharacter: NotRequired[Uint]
""" The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line. """
kind: NotRequired['FoldingRangeKind']