API Reference
CallHierarchyIncomingCall
Bases: BaseModel
Represents an incoming call, as part of the call hierarchy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_ |
CallHierarchyItem
|
The item that makes the call. |
required |
fromRanges |
List[Range]
|
The ranges at which the calls appear. |
required |
Source code in tarts\structs.py
725 726 727 728 729 730 731 732 733 734 735 736 737 738 | |
CallHierarchyItem
Bases: BaseModel
Represents an item of a call hierarchy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
The name of this item. |
required |
kind |
SymbolKind
|
The kind of this item. |
required |
tags |
Optional[SymbolTag]
|
Tags for this item. |
required |
detail |
Optional[str]
|
More detail for this item. |
required |
uri |
str
|
The resource identifier of this item. |
required |
range |
Range
|
The range enclosing this symbol. |
required |
selectionRange |
Range
|
The range that should be selected and revealed when this symbol is being picked. |
required |
data |
Optional[Any]
|
A data entry field that is preserved between a call hierarchy prepare and incoming calls or outgoing calls requests. |
required |
Source code in tarts\structs.py
701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 | |
CallHierarchyOutgoingCall
Bases: BaseModel
Represents an outgoing call, as part of the call hierarchy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
to |
CallHierarchyItem
|
The item that is called. |
required |
fromRanges |
List[Range]
|
The ranges at which this item is called. |
required |
Source code in tarts\structs.py
741 742 743 744 745 746 747 748 749 750 | |
CodeDescription
Bases: BaseModel
Represents a code description.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
href |
str
|
The URI to the code description. |
required |
Source code in tarts\structs.py
543 544 545 546 547 548 549 550 | |
Command
Bases: BaseModel
Represents a reference to a command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title |
str
|
Title of the command, like |
required |
command |
str
|
The identifier of the actual command handler. |
required |
arguments |
Optional[List[Any]]
|
Arguments that the command handler should be invoked with. |
required |
Source code in tarts\structs.py
351 352 353 354 355 356 357 358 359 360 361 362 | |
CompletionContext
Bases: BaseModel
Contains additional information about the context in which a completion request is triggered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
triggerKind |
CompletionTriggerKind
|
How the completion was triggered. |
required |
triggerCharacter |
Optional[str]
|
The trigger character that caused the completion. |
required |
Source code in tarts\structs.py
289 290 291 292 293 294 295 296 297 298 | |
CompletionItem
Bases: BaseModel
A completion item represents a text snippet that is proposed to complete text that is being typed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label |
str
|
The label of this completion item. |
required |
kind |
Optional[CompletionItemKind]
|
The kind of this completion item. |
required |
tags |
Optional[CompletionItemTag]
|
Tags for this completion item. |
required |
detail |
Optional[str]
|
A human-readable string with additional information about this item. |
required |
documentation |
Union[str, MarkupContent, None]
|
A human-readable string that represents a doc-comment. |
required |
deprecated |
Optional[bool]
|
Indicates if this item is deprecated. |
required |
preselect |
Optional[bool]
|
Select this item when showing. |
required |
sortText |
Optional[str]
|
A string that should be used when comparing this item with other items. |
required |
filterText |
Optional[str]
|
A string that should be used when filtering a set of completion items. |
required |
insertText |
Optional[str]
|
A string that should be inserted into a document when selecting this completion. |
required |
insertTextFormat |
Optional[InsertTextFormat]
|
The format of the insert text. |
required |
textEdit |
Optional[TextEdit]
|
An edit which is applied to a document when selecting this completion. |
required |
additionalTextEdits |
Optional[List[TextEdit]]
|
An optional array of additional text edits that are applied when selecting this completion. |
required |
commitCharacters |
Optional[List[str]]
|
An optional set of characters that when pressed while this completion is active will accept it first and then type that character. |
required |
command |
Optional[Command]
|
An optional command that is executed after inserting this completion. |
required |
data |
Optional[Any]
|
A data entry field that is preserved on a completion item between a completion and a completion resolve request. |
required |
Source code in tarts\structs.py
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 | |
CompletionItemKind
Bases: IntEnum
The kind of a completion entry.
Source code in tarts\structs.py
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 | |
CompletionItemTag
Bases: IntEnum
Completion item tags are extra annotations that tweak the rendering of a completion item.
Attributes:
| Name | Type | Description |
|---|---|---|
DEPRECATED |
Renders a completion as obsolete, usually using a strike-out. |
Source code in tarts\structs.py
411 412 413 414 415 416 417 418 | |
CompletionList
Bases: BaseModel
Represents a collection of completion items to be presented in the editor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
isIncomplete |
bool
|
This list is not complete. Further typing should result in recomputing this list. |
required |
items |
List[CompletionItem]
|
The completion items. |
required |
Source code in tarts\structs.py
461 462 463 464 465 466 467 468 469 470 | |
CompletionTriggerKind
Bases: IntEnum
Defines how the completion was triggered.
Attributes:
| Name | Type | Description |
|---|---|---|
INVOKED |
Completion was triggered by typing an identifier. |
|
TRIGGER_CHARACTER |
Completion was triggered by a trigger character. |
|
TRIGGER_FOR_INCOMPLETE_COMPLETIONS |
Completion was re-triggered as the current completion list is incomplete. |
Source code in tarts\structs.py
275 276 277 278 279 280 281 282 283 284 285 286 | |
ConfigurationItem
Bases: BaseModel
Represents a configuration item.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scopeUri |
Optional[str]
|
The scope URI for this configuration item. |
required |
section |
Optional[str]
|
The section of the configuration this item belongs to. |
required |
Source code in tarts\structs.py
996 997 998 999 1000 1001 1002 1003 1004 1005 | |
Diagnostic
Bases: BaseModel
Represents a diagnostic, such as a compiler error or warning.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
range |
Range
|
The range at which the message applies. |
required |
severity |
Optional[DiagnosticSeverity]
|
The diagnostic's severity. |
required |
code |
Optional[Union[int, str]]
|
The diagnostic's code, which might appear in the user interface. |
required |
codeDescription |
Optional[CodeDescription]
|
An optional code description. |
required |
source |
Optional[str]
|
A human-readable string describing the source of this diagnostic. |
required |
message |
str
|
The diagnostic's message. |
required |
tags |
Optional[List[DiagnosticTag]]
|
Additional metadata about the diagnostic. |
required |
relatedInformation |
Optional[List[DiagnosticRelatedInformation]]
|
Related diagnostic information. |
required |
data |
Optional[Any]
|
Additional structured data about the diagnostic. |
required |
Source code in tarts\structs.py
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | |
DiagnosticRelatedInformation
Bases: BaseModel
Represents additional information related to a diagnostic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location |
Location
|
The location of this related diagnostic information. |
required |
message |
str
|
The message of this related diagnostic information. |
required |
Source code in tarts\structs.py
515 516 517 518 519 520 521 522 523 524 | |
DiagnosticSeverity
Bases: IntEnum
Enumeration of diagnostic severity levels.
Attributes:
| Name | Type | Description |
|---|---|---|
ERROR |
int
|
Error severity level. |
WARNING |
int
|
Warning severity level. |
INFORMATION |
int
|
Information severity level. |
HINT |
int
|
Hint severity level. |
Source code in tarts\structs.py
527 528 529 530 531 532 533 534 535 536 537 538 539 540 | |
DiagnosticTag
Bases: IntEnum
Enumeration of diagnostic tags.
Attributes:
| Name | Type | Description |
|---|---|---|
UNNECESSARY |
int
|
Unnecessary code. |
DEPRECATED |
int
|
Deprecated code. |
Source code in tarts\structs.py
553 554 555 556 557 558 559 560 561 562 | |
DocumentSymbol
Bases: BaseModel
Represents programming constructs like variables, classes, interfaces etc. that appear in a document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
The name of this symbol. |
required |
detail |
Optional[str]
|
More detail for this symbol, e.g. the signature of a function. |
required |
kind |
SymbolKind
|
The kind of this symbol. |
required |
tags |
Optional[List[SymbolTag]]
|
Tags for this symbol. |
required |
deprecated |
Optional[bool]
|
Indicates if this symbol is deprecated. |
required |
range |
Range
|
The range enclosing this symbol not including leading/trailing whitespace but everything else. |
required |
selectionRange |
Range
|
The range that should be selected and revealed when this symbol is being picked. |
required |
children |
Optional[List[DocumentSymbol]]
|
Children of this symbol, e.g. properties of a class. |
required |
Source code in tarts\structs.py
859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 | |
FoldingRange
Bases: BaseModel
Represents a folding range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
startLine |
int
|
The zero-based start line of the range to fold. |
required |
startCharacter |
Optional[int]
|
The zero-based start character of the range to fold. |
required |
endLine |
int
|
The zero-based end line of the range to fold. |
required |
endCharacter |
Optional[int]
|
The zero-based end character of the range to fold. |
required |
kind |
Optional[str]
|
The kind of this folding range (e.g., 'comment', 'imports', 'region'). |
required |
collapsedText |
Optional[str]
|
The text that the client should show when the specified range is collapsed. |
required |
Source code in tarts\structs.py
839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 | |
FormattingOptions
Bases: BaseModel
Represents formatting options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tabSize |
int
|
Size of a tab in spaces. |
required |
insertSpaces |
bool
|
Prefer spaces over tabs. |
required |
trimTrailingWhitespace |
Optional[bool]
|
Trim trailing whitespace on a line. |
required |
insertFinalNewline |
Optional[bool]
|
Insert a newline character at the end of the file if one does not exist. |
required |
trimFinalNewlines |
Optional[bool]
|
Trim all newlines after the final newline at the end of the file. |
required |
Source code in tarts\structs.py
900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 | |
InlayHint
Bases: BaseModel
Represents an inlay hint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position |
Position
|
The position of this hint. |
required |
label |
Union[str, List[InlayHintLabelPart]]
|
The label of this hint. |
required |
kind |
Optional[InlayHintKind]
|
The kind of this hint. |
required |
textEdits |
Optional[List[TextEdit]]
|
Optional text edits that are performed when accepting this inlay hint. |
required |
tooltip |
Optional[Union[str, MarkupContent]]
|
The tooltip text when you hover over this item. |
required |
paddingLeft |
Optional[bool]
|
Whether the inlay hint should be padded with a space on the left. |
required |
paddingRight |
Optional[bool]
|
Whether the inlay hint should be padded with a space on the right. |
required |
data |
Optional[Any]
|
A data entry field that is preserved on an inlay hint between a textDocument/inlayHint request and a inlayHint/resolve request. |
required |
Source code in tarts\structs.py
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 | |
InlayHintKind
Bases: IntEnum
Enumeration of inlay hint kinds.
Attributes:
| Name | Type | Description |
|---|---|---|
TYPE |
int
|
Type hint. |
PARAMETER |
int
|
Parameter hint. |
Source code in tarts\structs.py
803 804 805 806 807 808 809 810 811 812 | |
InlayHintLabelPart
Bases: BaseModel
Represents a part of an inlay hint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
str
|
The value of this label part. |
required |
tooltip |
Optional[Union[str, MarkupContent]]
|
The tooltip text when you hover over this label part. |
required |
location |
Optional[Location]
|
An optional source code location that represents this label part. |
required |
command |
Optional[Command]
|
An optional command for this label part. |
required |
Source code in tarts\structs.py
787 788 789 790 791 792 793 794 795 796 797 798 799 800 | |
InsertTextFormat
Bases: IntEnum
Defines whether the insert text in a completion item should be interpreted as plain text or a snippet.
Attributes:
| Name | Type | Description |
|---|---|---|
PLAIN_TEXT |
The primary text should be interpreted as plain text. |
|
SNIPPET |
The primary text should be interpreted as a snippet. |
Source code in tarts\structs.py
365 366 367 368 369 370 371 372 373 374 | |
Location
Bases: BaseModel
Represents a location inside a resource, such as a line inside a text file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri |
str
|
The text document's URI. |
required |
range |
Range
|
The range inside the text document. |
required |
Source code in tarts\structs.py
487 488 489 490 491 492 493 494 495 496 | |
LocationLink
Bases: BaseModel
Represents a link between a source and a target location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
originSelectionRange |
Optional[Range]
|
Span of the origin of this link. |
required |
targetUri |
str
|
The target resource identifier of this link. |
required |
targetRange |
Range
|
The full target range of this link. |
required |
targetSelectionRange |
Range
|
The span of the target of this link. |
required |
Source code in tarts\structs.py
499 500 501 502 503 504 505 506 507 508 509 510 511 512 | |
MWorkDoneProgressKind
Bases: Enum
Enumeration of work done progress kinds.
Source code in tarts\structs.py
942 943 944 945 946 947 | |
MarkedString
Bases: BaseModel
Represents a string with a specific language.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
language |
str
|
The language of the string (e.g., 'python', 'javascript'). |
required |
value |
str
|
The string value. |
required |
Source code in tarts\structs.py
591 592 593 594 595 596 597 598 599 600 | |
MarkupContent
Bases: BaseModel
Represents a string value which content can be represented in different formats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind |
MarkupKind
|
The type of markup used. |
required |
value |
str
|
The content itself. |
required |
Source code in tarts\structs.py
313 314 315 316 317 318 319 320 321 322 | |
MarkupKind
Bases: Enum
Describes the content type that a client supports in various result literals like Hover, ParameterInfo or CompletionItem.
Attributes:
| Name | Type | Description |
|---|---|---|
PLAINTEXT |
The primary text to be rendered is to be interpreted as plain text. |
|
MARKDOWN |
The primary text to be rendered is to be interpreted as Markdown. |
Source code in tarts\structs.py
301 302 303 304 305 306 307 308 309 310 | |
MessageActionItem
Bases: BaseModel
Action item for LSP notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title(str) |
The title of the action. |
required |
Source code in tarts\structs.py
66 67 68 69 70 71 72 73 | |
MessageType
Bases: IntEnum
Message type for LSP notifications.
Attributes:
| Name | Type | Description |
|---|---|---|
ERROR |
int
|
Error message. |
WARNING |
int
|
Warning message. |
INFO |
int
|
Information message. |
LOG |
int
|
Log message. |
Source code in tarts\structs.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
OptionalVersionedTextDocumentIdentifier
Bases: TextDocumentIdentifier
Text document identifier with an optional version for LSP requests.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri(str) |
The URI of the document |
required | |
version(int) |
The version of the document |
required |
Source code in tarts\structs.py
102 103 104 105 106 107 108 109 110 | |
ParameterInformation
Bases: BaseModel
Represents information about a parameter of a callable-signature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label |
Union[str, Tuple[int, int]]
|
The label of this parameter information. |
required |
documentation |
Optional[Union[str, MarkupContent]]
|
The human-readable doc-comment of this parameter. |
required |
Source code in tarts\structs.py
603 604 605 606 607 608 609 610 611 612 | |
Position
Bases: BaseModel
Position in a text document.
Methods:
| Name | Description |
|---|---|
as_tuple |
Return the position as a tuple. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line |
int
|
The line number (0-based). |
required |
character |
int
|
The character number (0-based). |
required |
Source code in tarts\structs.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
as_tuple()
Return the position as a tuple.
Returns:
| Type | Description |
|---|---|
Tuple[int, int]
|
Tuple[int, int]: The position as a tuple. |
Source code in tarts\structs.py
140 141 142 143 144 145 146 147 | |
ProgressValue
Bases: BaseModel
Base class for progress values.
Source code in tarts\structs.py
930 931 932 933 | |
Range
Bases: BaseModel
Represents a range in a text document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start |
Position
|
The start position of the range. |
required |
end |
Position
|
The end position of the range. |
required |
Source code in tarts\structs.py
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 | |
calculate_length(text)
Calculate the length of the range in the given text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text |
str
|
The text to calculate the range length in. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The length of the range. |
Source code in tarts\structs.py
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 | |
Registration
Bases: BaseModel
Represents a registration of a capability.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id |
str
|
The id used to register the request. The id can be used to deregister the request again. |
required |
method |
str
|
The method / capability to register for. |
required |
registerOptions |
Optional[Any]
|
Options necessary for the registration. |
required |
Source code in tarts\structs.py
886 887 888 889 890 891 892 893 894 895 896 897 | |
Request
Bases: BaseModel
Base class for LSP requests.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method(str) |
The method of the request. |
required | |
id |
Id
|
The request ID. |
required |
params |
JSONDict
|
The parameters of the request. |
required |
Source code in tarts\structs.py
20 21 22 23 24 25 26 27 28 29 30 31 | |
Response
Bases: BaseModel
Base class for LSP responses.
The result field is either a list of values or a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id |
Id
|
The request ID. |
required |
result(List[Any] |
| JSONDict
|
The result of the request. |
required |
error |
The error that occurred during the request. |
required |
Source code in tarts\structs.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
SignatureInformation
Bases: BaseModel
Represents the signature of something callable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label |
str
|
The label of this signature. |
required |
documentation |
Optional[Union[MarkupContent, str]]
|
The human-readable doc-comment of this signature. |
required |
parameters |
Optional[List[ParameterInformation]]
|
The parameters of this signature. |
required |
activeParameter |
Optional[int]
|
The index of the active parameter. |
required |
Source code in tarts\structs.py
615 616 617 618 619 620 621 622 623 624 625 626 627 628 | |
SymbolInformation
Bases: BaseModel
Represents information about programming constructs like variables, classes, interfaces etc.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
The name of this symbol. |
required |
kind |
SymbolKind
|
The kind of this symbol. |
required |
tags |
Optional[List[SymbolTag]]
|
Tags for this symbol. |
required |
deprecated |
Optional[bool]
|
Indicates if this symbol is deprecated. |
required |
location |
Location
|
The location of this symbol. |
required |
containerName |
Optional[str]
|
The name of the symbol containing this symbol. |
required |
Source code in tarts\structs.py
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 | |
SymbolKind
Bases: IntEnum
Enumeration of symbol kinds.
Attributes:
| Name | Type | Description |
|---|---|---|
FILE |
int
|
A file symbol. |
MODULE |
int
|
A module symbol. |
NAMESPACE |
int
|
A namespace symbol. |
PACKAGE |
int
|
A package symbol. |
CLASS |
int
|
A class symbol. |
METHOD |
int
|
A method symbol. |
PROPERTY |
int
|
A property symbol. |
FIELD |
int
|
A field symbol. |
CONSTRUCTOR |
int
|
A constructor symbol. |
ENUM |
int
|
An enum symbol. |
INTERFACE |
int
|
An interface symbol. |
FUNCTION |
int
|
A function symbol. |
VARIABLE |
int
|
A variable symbol. |
CONSTANT |
int
|
A constant symbol. |
STRING |
int
|
A string symbol. |
NUMBER |
int
|
A number symbol. |
BOOLEAN |
int
|
A boolean symbol. |
ARRAY |
int
|
An array symbol. |
OBJECT |
int
|
An object symbol. |
KEY |
int
|
A key symbol. |
NULL |
int
|
A null symbol. |
ENUMMEMBER |
int
|
An enum member symbol. |
STRUCT |
int
|
A struct symbol. |
EVENT |
int
|
An event symbol. |
OPERATOR |
int
|
An operator symbol. |
TYPEPARAMETER |
int
|
A type parameter symbol. |
Source code in tarts\structs.py
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 | |
SymbolTag
Bases: IntEnum
Enumeration of symbol tags.
Attributes:
| Name | Type | Description |
|---|---|---|
DEPRECATED |
int
|
Indicates that a symbol is deprecated. |
Source code in tarts\structs.py
691 692 693 694 695 696 697 698 | |
TextDocumentContentChangeEvent
Bases: BaseModel
Represents a content change event in a text document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text |
str
|
The new text of the document. |
required |
range |
Optional[Range]
|
The range of the document that changed. |
required |
rangeLength |
Optional[int]
|
The length of the range that changed (deprecated, use .range). |
required |
Source code in tarts\structs.py
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 | |
dict(**kwargs)
Return a dictionary representation of the event.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict[str, Any]: A dictionary representation of the event. |
Source code in tarts\structs.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
range_change(change_start, change_end, change_text, old_text)
classmethod
Create a TextDocumentContentChangeEvent reflecting the given changes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
change_start |
Position
|
The start position of the change. |
required |
change_end |
Position
|
The end position of the change. |
required |
change_text |
str
|
The new text for the changed range. |
required |
old_text |
str
|
The old text of the document. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
TextDocumentContentChangeEvent |
TextDocumentContentChangeEvent
|
A new instance representing the change. |
Note
If you're creating a list of TextDocumentContentChangeEvent based on many changes,
old_text must reflect the state of the text after all previous change events happened.
Source code in tarts\structs.py
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 | |
whole_document_change(change_text)
classmethod
Create a TextDocumentContentChangeEvent for a whole document change.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
change_text |
str
|
The new text of the entire document. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
TextDocumentContentChangeEvent |
TextDocumentContentChangeEvent
|
A new instance representing the whole document change. |
Source code in tarts\structs.py
248 249 250 251 252 253 254 255 256 257 258 259 260 | |
TextDocumentEdit
Bases: BaseModel
Describes textual changes on a single text document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
textDocument |
OptionalVersionedTextDocumentIdentifier
|
The text document to change. |
required |
edits |
List[TextEdit]
|
The edits to be applied. |
required |
Source code in tarts\structs.py
339 340 341 342 343 344 345 346 347 348 | |
TextDocumentIdentifier
Bases: BaseModel
Text document identifier for LSP requests.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri(str) |
The URI of the document |
required |
Source code in tarts\structs.py
92 93 94 95 96 97 98 99 | |
TextDocumentItem
Bases: BaseModel
Text document item for LSP notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri(str) |
The URI of the document. |
required | |
languageId(str) |
The language ID of the document. |
required | |
version(int) |
The version of the document. |
required | |
text(str) |
The text of the document. |
required |
Source code in tarts\structs.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
TextDocumentPosition
Bases: BaseModel
Represents a position in a text document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
textDocument |
TextDocumentIdentifier
|
The text document. |
required |
position |
Position
|
The position inside the text document. |
required |
Source code in tarts\structs.py
263 264 265 266 267 268 269 270 271 272 | |
TextDocumentSaveReason
Bases: IntEnum
Represents reasons why a text document is saved.
Attributes:
| Name | Type | Description |
|---|---|---|
MANUAL |
Manually triggered, e.g. by the user pressing save, by starting debugging, or by an API call. |
|
AFTER_DELAY |
Automatic after a delay. |
|
FOCUS_OUT |
When the editor lost focus. |
Source code in tarts\structs.py
473 474 475 476 477 478 479 480 481 482 483 484 | |
TextDocumentSyncKind
Bases: IntEnum
Enumeration of text document synchronization kinds.
Attributes:
| Name | Type | Description |
|---|---|---|
NONE |
int
|
Documents should not be synced at all. |
FULL |
int
|
Documents are synced by always sending the full content of the document. |
INCREMENTAL |
int
|
Documents are synced by sending incremental updates to the document. |
Source code in tarts\structs.py
753 754 755 756 757 758 759 760 761 762 763 764 | |
TextEdit
Bases: BaseModel
A text edit applicable to a text document.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
range |
Range
|
The range of the text document to be manipulated. |
required |
newText |
str
|
The string to be inserted. For delete operations use an empty string. |
required |
annotationId |
Optional[str]
|
An optional identifier of the edit. |
required |
Source code in tarts\structs.py
325 326 327 328 329 330 331 332 333 334 335 336 | |
VersionedTextDocumentIdentifier
Bases: TextDocumentIdentifier
Text document identifier with a version for LSP notifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri(str) |
The URI of the document |
required | |
version(int) |
The version of the document |
required |
Source code in tarts\structs.py
113 114 115 116 117 118 119 120 121 | |
WorkDoneProgressBeginValue
Bases: WorkDoneProgressValue
Represents the beginning of a work done progress.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind |
Literal['begin']
|
The kind of progress (always "begin" for this class). |
required |
title |
str
|
The title of the progress operation. |
required |
cancellable |
Optional[bool]
|
Whether the operation is cancellable. |
required |
message |
Optional[str]
|
An optional message providing additional details. |
required |
percentage |
Optional[int]
|
An optional initial percentage of the progress. |
required |
Source code in tarts\structs.py
950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 | |
WorkDoneProgressEndValue
Bases: WorkDoneProgressValue
Represents the end of a work done progress.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind |
Literal['end']
|
The kind of progress (always "end" for this class). |
required |
message |
Optional[str]
|
An optional message providing final details or results. |
required |
Source code in tarts\structs.py
984 985 986 987 988 989 990 991 992 993 | |
WorkDoneProgressReportValue
Bases: WorkDoneProgressValue
Represents a report of ongoing work done progress.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind |
Literal['report']
|
The kind of progress (always "report" for this class). |
required |
cancellable |
Optional[bool]
|
Whether the operation is cancellable. |
required |
message |
Optional[str]
|
An optional message providing additional details. |
required |
percentage |
Optional[int]
|
An optional updated percentage of the progress. |
required |
Source code in tarts\structs.py
968 969 970 971 972 973 974 975 976 977 978 979 980 981 | |
WorkDoneProgressValue
Bases: ProgressValue
Base class for work done progress values.
Source code in tarts\structs.py
936 937 938 939 | |
WorkspaceFolder
Bases: BaseModel
Represents a workspace folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uri |
str
|
The associated URI for this workspace folder. |
required |
name |
str
|
The name of the workspace folder. |
required |
Source code in tarts\structs.py
918 919 920 921 922 923 924 925 926 927 | |