-
Notifications
You must be signed in to change notification settings - Fork 332
/
Copy pathprotocol.ts
1997 lines (1743 loc) · 54.7 KB
/
protocol.ts
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
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
import * as Is from './utils/is';
import { RequestType, RequestType0, NotificationType, NotificationType0 } from 'vscode-jsonrpc';
import {
TextDocumentContentChangeEvent, Position, Range, Location, LocationLink, Diagnostic, Command,
TextEdit, WorkspaceEdit, WorkspaceSymbolParams,
TextDocumentIdentifier, VersionedTextDocumentIdentifier, TextDocumentItem, TextDocumentSaveReason,
CompletionItem, CompletionList, Hover, SignatureHelp,
Definition, DefinitionLink, ReferenceContext, DocumentHighlight, DocumentSymbolParams,
SymbolInformation, CodeLens, CodeActionContext, FormattingOptions, DocumentLink, MarkupKind,
SymbolKind, CompletionItemKind, CodeAction, CodeActionKind, DocumentSymbol
} from 'vscode-languageserver-types';
import { ImplementationRequest, ImplementationClientCapabilities, ImplementationServerCapabilities } from './protocol.implementation';
import { TypeDefinitionRequest, TypeDefinitionClientCapabilities, TypeDefinitionServerCapabilities } from './protocol.typeDefinition';
import {
WorkspaceFoldersRequest, DidChangeWorkspaceFoldersNotification, DidChangeWorkspaceFoldersParams, WorkspaceFolder,
WorkspaceFoldersChangeEvent, WorkspaceFoldersInitializeParams, WorkspaceFoldersClientCapabilities, WorkspaceFoldersServerCapabilities
} from './protocol.workspaceFolders';
import { ConfigurationRequest, ConfigurationParams, ConfigurationItem, ConfigurationClientCapabilities } from './protocol.configuration';
import {
DocumentColorRequest, ColorPresentationRequest, ColorProviderOptions, DocumentColorParams, ColorPresentationParams,
ColorServerCapabilities, ColorClientCapabilities,
} from './protocol.colorProvider';
import {
FoldingRangeClientCapabilities, FoldingRangeProviderOptions, FoldingRangeRequest, FoldingRangeParams, FoldingRangeServerCapabilities
} from './protocol.foldingRange';
import {
DeclarationClientCapabilities, DeclarationRequest, DeclarationServerCapabilities
} from './protocol.declaration';
import {
SelectionRangeClientCapabilities, SelectionRangeProviderOptions, SelectionRangeRequest, SelectionRangeServerCapabilities,
SelectionRangeKind, SelectionRange, SelectionRangeParams
} from './protocol.selectionRange';
// @ts-ignore: to avoid inlining LocatioLink as dynamic import
let __noDynamicImport: LocationLink | undefined;
/**
* A document filter denotes a document by different properties like
* the [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of
* its resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName).
*
* 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`)
*
* @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' }`
*/
export type DocumentFilter = {
/** A language id, like `typescript`. */
language: string;
/** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */
scheme?: string;
/** A glob pattern, like `*.{ts,js}`. */
pattern?: string;
} | {
/** A language id, like `typescript`. */
language?: string;
/** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */
scheme: string;
/** A glob pattern, like `*.{ts,js}`. */
pattern?: string;
} | {
/** A language id, like `typescript`. */
language?: string;
/** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */
scheme?: string;
/** A glob pattern, like `*.{ts,js}`. */
pattern: string;
};
export namespace DocumentFilter {
export function is(value: any): value is DocumentFilter {
let candidate: DocumentFilter = value;
return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern);
}
}
/**
* A document selector is the combination of one or many document filters.
*
* @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`;
*/
export type DocumentSelector = (string | DocumentFilter)[];
/**
* General parameters to to register for an notification or to register a provider.
*/
export interface Registration {
/**
* The id used to register the request. The id can be used to deregister
* the request again.
*/
id: string;
/**
* The method to register for.
*/
method: string;
/**
* Options necessary for the registration.
*/
registerOptions?: any;
}
export interface RegistrationParams {
registrations: Registration[];
}
/**
* The `client/registerCapability` request is sent from the server to the client to register a new capability
* handler on the client side.
*/
export namespace RegistrationRequest {
export const type = new RequestType<RegistrationParams, void, void, void>('client/registerCapability');
}
/**
* General parameters to unregister a request or notification.
*/
export interface Unregistration {
/**
* The id used to unregister the request or notification. Usually an id
* provided during the register request.
*/
id: string;
/**
* The method to unregister for.
*/
method: string;
}
export interface UnregistrationParams {
unregisterations: Unregistration[];
}
/**
* The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability
* handler on the client side.
*/
export namespace UnregistrationRequest {
export const type = new RequestType<UnregistrationParams, void, void, void>('client/unregisterCapability');
}
/**
* A parameter literal used in requests to pass a text document and a position inside that
* document.
*/
export interface TextDocumentPositionParams {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The position inside the text document.
*/
position: Position;
}
//---- Initialize Method ----
/**
* The kind of resource operations supported by the client.
*/
export type ResourceOperationKind = 'create' | 'rename' | 'delete';
export namespace ResourceOperationKind {
/**
* Supports creating new files and folders.
*/
export const Create: ResourceOperationKind = 'create';
/**
* Supports renaming existing files and folders.
*/
export const Rename: ResourceOperationKind = 'rename';
/**
* Supports deleting existing files and folders.
*/
export const Delete: ResourceOperationKind = 'delete';
}
export type FailureHandlingKind = 'abort' | 'transactional' | 'undo' | 'textOnlyTransactional';
export namespace FailureHandlingKind {
/**
* Applying the workspace change is simply aborted if one of the changes provided
* fails. All operations executed before the failing operation stay executed.
*/
export const Abort: FailureHandlingKind = 'abort';
/**
* All operations are executed transactional. That means they either all
* succeed or no changes at all are applied to the workspace.
*/
export const Transactional: FailureHandlingKind = 'transactional';
/**
* 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 startegy is abort.
*/
export const TextOnlyTransactional: FailureHandlingKind = 'textOnlyTransactional';
/**
* The client tries to undo the operations already executed. But there is no
* guaruntee that this is succeeding.
*/
export const Undo: FailureHandlingKind = 'undo';
}
/**
* Workspace specific client capabilities.
*/
export interface WorkspaceClientCapabilities {
/**
* The client supports applying batch edits
* to the workspace by supporting the request
* 'workspace/applyEdit'
*/
applyEdit?: boolean;
/**
* Capabilities specific to `WorkspaceEdit`s
*/
workspaceEdit?: {
/**
* The client supports versioned document changes in `WorkspaceEdit`s
*/
documentChanges?: boolean;
/**
* The resource operations the client supports. Clients should at least
* support 'create', 'rename' and 'delete' files and folders.
*/
resourceOperations?: ResourceOperationKind[];
/**
* The failure handling strategy of a client if applying the workspace edit
* failes.
*/
failureHandling?: FailureHandlingKind;
};
/**
* Capabilities specific to the `workspace/didChangeConfiguration` notification.
*/
didChangeConfiguration?: {
/**
* Did change configuration notification supports dynamic registration.
*/
dynamicRegistration?: boolean;
};
/**
* Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
*/
didChangeWatchedFiles?: {
/**
* Did change watched files notification supports dynamic registration. Please note
* that the current protocol doesn't support static configuration for file changes
* from the server side.
*/
dynamicRegistration?: boolean;
};
/**
* Capabilities specific to the `workspace/symbol` request.
*/
symbol?: {
/**
* Symbol request supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
*/
symbolKind?: {
/**
* The symbol kind values the client supports. When this
* property exists the client also guarantees that it will
* handle values outside its set gracefully and falls back
* to a default value when unknown.
*
* If this property is not present the client only supports
* the symbol kinds from `File` to `Array` as defined in
* the initial version of the protocol.
*/
valueSet?: SymbolKind[];
}
};
/**
* Capabilities specific to the `workspace/executeCommand` request.
*/
executeCommand?: {
/**
* Execute command supports dynamic registration.
*/
dynamicRegistration?: boolean;
};
}
/**
* Text document specific client capabilities.
*/
export interface TextDocumentClientCapabilities {
/**
* Defines which synchronization capabilities the client supports.
*/
synchronization?: {
/**
* Whether text document synchronization supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* The client supports sending will save notifications.
*/
willSave?: boolean;
/**
* The client supports sending a will save request and
* waits for a response providing text edits which will
* be applied to the document before it is saved.
*/
willSaveWaitUntil?: boolean;
/**
* The client supports did save notifications.
*/
didSave?: boolean;
};
/**
* Capabilities specific to the `textDocument/completion`
*/
completion?: {
/**
* Whether completion supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* The client supports the following `CompletionItem` specific
* capabilities.
*/
completionItem?: {
/**
* Client supports snippets as insert text.
*
* 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.
*/
snippetSupport?: boolean;
/**
* Client supports commit characters on a completion item.
*/
commitCharactersSupport?: boolean
/**
* Client supports the follow content formats for the documentation
* property. The order describes the preferred format of the client.
*/
documentationFormat?: MarkupKind[];
/**
* Client supports the deprecated property on a completion item.
*/
deprecatedSupport?: boolean;
/**
* Client supports the preselect property on a completion item.
*/
preselectSupport?: boolean;
},
completionItemKind?: {
/**
* The completion item kind values the client supports. When this
* property exists the client also guarantees that it will
* handle values outside its set gracefully and falls back
* to a default value when unknown.
*
* If this property is not present the client only supports
* the completion items kinds from `Text` to `Reference` as defined in
* the initial version of the protocol.
*/
valueSet?: CompletionItemKind[];
},
/**
* The client supports to send additional context information for a
* `textDocument/completion` requestion.
*/
contextSupport?: boolean;
};
/**
* Capabilities specific to the `textDocument/hover`
*/
hover?: {
/**
* Whether hover supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* Client supports the follow content formats for the content
* property. The order describes the preferred format of the client.
*/
contentFormat?: MarkupKind[];
};
/**
* Capabilities specific to the `textDocument/signatureHelp`
*/
signatureHelp?: {
/**
* Whether signature help supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* The client supports the following `SignatureInformation`
* specific properties.
*/
signatureInformation?: {
/**
* Client supports the follow content formats for the documentation
* property. The order describes the preferred format of the client.
*/
documentationFormat?: MarkupKind[];
/**
* Client capabilities specific to parameter information.
*/
parameterInformation?: {
/**
* The client supports processing label offsets instead of a
* simple label string.
*/
labelOffsetSupport?: boolean;
}
};
};
/**
* Capabilities specific to the `textDocument/references`
*/
references?: {
/**
* Whether references supports dynamic registration.
*/
dynamicRegistration?: boolean;
};
/**
* Capabilities specific to the `textDocument/documentHighlight`
*/
documentHighlight?: {
/**
* Whether document highlight supports dynamic registration.
*/
dynamicRegistration?: boolean;
};
/**
* Capabilities specific to the `textDocument/documentSymbol`
*/
documentSymbol?: {
/**
* Whether document symbol supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* Specific capabilities for the `SymbolKind`.
*/
symbolKind?: {
/**
* The symbol kind values the client supports. When this
* property exists the client also guarantees that it will
* handle values outside its set gracefully and falls back
* to a default value when unknown.
*
* If this property is not present the client only supports
* the symbol kinds from `File` to `Array` as defined in
* the initial version of the protocol.
*/
valueSet?: SymbolKind[];
},
/**
* The client support hierarchical document symbols.
*/
hierarchicalDocumentSymbolSupport?: boolean;
};
/**
* Capabilities specific to the `textDocument/formatting`
*/
formatting?: {
/**
* Whether formatting supports dynamic registration.
*/
dynamicRegistration?: boolean;
};
/**
* Capabilities specific to the `textDocument/rangeFormatting`
*/
rangeFormatting?: {
/**
* Whether range formatting supports dynamic registration.
*/
dynamicRegistration?: boolean;
};
/**
* Capabilities specific to the `textDocument/onTypeFormatting`
*/
onTypeFormatting?: {
/**
* Whether on type formatting supports dynamic registration.
*/
dynamicRegistration?: boolean;
};
/**
* Capabilities specific to the `textDocument/definition`
*/
definition?: {
/**
* Whether definition supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* The client supports additional metadata in the form of definition links.
*/
linkSupport?: boolean;
};
/**
* Capabilities specific to the `textDocument/codeAction`
*/
codeAction?: {
/**
* Whether code action supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* The client support code action literals as a valid
* response of the `textDocument/codeAction` request.
*/
codeActionLiteralSupport?: {
/**
* The code action kind is support with the following value
* set.
*/
codeActionKind: {
/**
* The code action kind values the client supports. When this
* property exists the client also guarantees that it will
* handle values outside its set gracefully and falls back
* to a default value when unknown.
*/
valueSet: CodeActionKind[];
};
};
};
/**
* Capabilities specific to the `textDocument/codeLens`
*/
codeLens?: {
/**
* Whether code lens supports dynamic registration.
*/
dynamicRegistration?: boolean;
};
/**
* Capabilities specific to the `textDocument/documentLink`
*/
documentLink?: {
/**
* Whether document link supports dynamic registration.
*/
dynamicRegistration?: boolean;
};
/**
* Capabilities specific to the `textDocument/rename`
*/
rename?: {
/**
* Whether rename supports dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* Client supports testing for validity of rename operations
* before execution.
*/
prepareSupport?: boolean;
};
/**
* Capabilities specific to `textDocument/publishDiagnostics`.
*/
publishDiagnostics?: {
/**
* Whether the clients accepts diagnostics with related information.
*/
relatedInformation?: boolean;
/**
* Client supports the tag property to provide meta data about a diagnostic.
*/
tagSupport?: boolean;
};
}
/**
* Defines the capabilities provided by the client.
*/
export interface _ClientCapabilities {
/**
* Workspace specific client capabilities.
*/
workspace?: WorkspaceClientCapabilities;
/**
* Text document specific client capabilities.
*/
textDocument?: TextDocumentClientCapabilities;
/**
* Experimental client capabilities.
*/
experimental?: any;
}
export type ClientCapabilities = _ClientCapabilities & ImplementationClientCapabilities & TypeDefinitionClientCapabilities &
WorkspaceFoldersClientCapabilities & ConfigurationClientCapabilities & ColorClientCapabilities & FoldingRangeClientCapabilities &
DeclarationClientCapabilities & SelectionRangeClientCapabilities;
/**
* Defines how the host (editor) should sync
* document changes to the language server.
*/
export namespace TextDocumentSyncKind {
/**
* Documents should not be synced at all.
*/
export const None = 0;
/**
* Documents are synced by always sending the full content
* of the document.
*/
export const Full = 1;
/**
* Documents are synced by sending the full content on open.
* After that only incremental updates to the document are
* send.
*/
export const Incremental = 2;
}
export type TextDocumentSyncKind = 0 | 1 | 2;
/**
* Static registration options to be returned in the initialize
* request.
*/
export interface StaticRegistrationOptions {
/**
* The id used to register the request. The id can be used to deregister
* the request again. See also Registration#id.
*/
id?: string;
}
/**
* General text document registration options.
*/
export interface TextDocumentRegistrationOptions {
/**
* 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.
*/
documentSelector: DocumentSelector | null;
}
/**
* Completion options.
*/
export interface CompletionOptions {
/**
* Most tools trigger completion request automatically without explicitly requesting
* it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user
* starts to type an identifier. For example if the user types `c` in a JavaScript file
* code complete will automatically pop up present `console` besides others as a
* completion item. Characters that make up identifiers don't need to be listed here.
*
* If code complete should automatically be trigger on characters not being valid inside
* an identifier (for example `.` in JavaScript) list them in `triggerCharacters`.
*/
triggerCharacters?: string[];
/**
* The list of all possible characters that commit a completion. This field can be used
* if clients don't support individual commmit characters per completion item. See
* `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`
*/
allCommitCharacters?: string[];
/**
* The server provides support to resolve additional
* information for a completion item.
*/
resolveProvider?: boolean;
}
/**
* Signature help options.
*/
export interface SignatureHelpOptions {
/**
* The characters that trigger signature help
* automatically.
*/
triggerCharacters?: string[];
}
/**
* Code Action options.
*/
export interface CodeActionOptions {
/**
* CodeActionKinds that this server may return.
*
* The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server
* may list out every specific kind they provide.
*/
codeActionKinds?: CodeActionKind[];
}
/**
* Code Lens options.
*/
export interface CodeLensOptions {
/**
* Code lens has a resolve provider as well.
*/
resolveProvider?: boolean;
}
/**
* Format document on type options
*/
export interface DocumentOnTypeFormattingOptions {
/**
* A character on which formatting should be triggered, like `}`.
*/
firstTriggerCharacter: string;
/**
* More trigger characters.
*/
moreTriggerCharacter?: string[];
}
/**
* Rename options
*/
export interface RenameOptions {
/**
* Renames should be checked and tested before being executed.
*/
prepareProvider?: boolean;
}
/**
* Document link options
*/
export interface DocumentLinkOptions {
/**
* Document links have a resolve provider as well.
*/
resolveProvider?: boolean;
}
/**
* Execute command options.
*/
export interface ExecuteCommandOptions {
/**
* The commands to be executed on the server
*/
commands: string[]
}
/**
* Save options.
*/
export interface SaveOptions {
/**
* The client is supposed to include the content on save.
*/
includeText?: boolean;
}
export interface TextDocumentSyncOptions {
/**
* Open and close notifications are sent to the server.
*/
openClose?: boolean;
/**
* Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
* and TextDocumentSyncKind.Incremental.
*/
change?: TextDocumentSyncKind;
/**
* Will save notifications are sent to the server.
*/
willSave?: boolean;
/**
* Will save wait until requests are sent to the server.
*/
willSaveWaitUntil?: boolean;
/**
* Save notifications are sent to the server.
*/
save?: SaveOptions;
}
/**
* Defines the capabilities provided by a language
* server.
*/
export interface _ServerCapabilities {
/**
* Defines how text documents are synced. Is either a detailed structure defining each notification or
* for backwards compatibility the TextDocumentSyncKind number.
*/
textDocumentSync?: TextDocumentSyncOptions | TextDocumentSyncKind;
/**
* The server provides hover support.
*/
hoverProvider?: boolean;
/**
* The server provides completion support.
*/
completionProvider?: CompletionOptions;
/**
* The server provides signature help support.
*/
signatureHelpProvider?: SignatureHelpOptions;
/**
* The server provides goto definition support.
*/
definitionProvider?: boolean;
/**
* The server provides find references support.
*/
referencesProvider?: boolean;
/**
* The server provides document highlight support.
*/
documentHighlightProvider?: boolean;
/**
* The server provides document symbol support.
*/
documentSymbolProvider?: boolean;
/**
* The server provides workspace symbol support.
*/
workspaceSymbolProvider?: boolean;
/**
* The server provides code actions. CodeActionOptions may only be
* specified if the client states that it supports
* `codeActionLiteralSupport` in its initial `initialize` request.
*/
codeActionProvider?: boolean | CodeActionOptions;
/**
* The server provides code lens.
*/
codeLensProvider?: CodeLensOptions;
/**
* The server provides document formatting.
*/
documentFormattingProvider?: boolean;
/**
* The server provides document range formatting.
*/
documentRangeFormattingProvider?: boolean;
/**
* The server provides document formatting on typing.
*/
documentOnTypeFormattingProvider?: {
/**
* A character on which formatting should be triggered, like `}`.
*/
firstTriggerCharacter: string;
/**
* More trigger characters.
*/
moreTriggerCharacter?: string[]
};
/**
* The server provides rename support. RenameOptions may only be
* specified if the client states that it supports
* `prepareSupport` in its initial `initialize` request.
*/
renameProvider?: boolean | RenameOptions;
/**
* The server provides document link support.
*/
documentLinkProvider?: DocumentLinkOptions;
/**
* The server provides execute command support.
*/
executeCommandProvider?: ExecuteCommandOptions;
/**
* Experimental server capabilities.
*/
experimental?: any;
}
export type ServerCapabilities = _ServerCapabilities & ImplementationServerCapabilities & TypeDefinitionServerCapabilities & WorkspaceFoldersServerCapabilities &
ColorServerCapabilities & FoldingRangeServerCapabilities & DeclarationServerCapabilities & SelectionRangeServerCapabilities;
/**
* The initialize request is sent from the client to the server.
* It is sent once as the request after starting up the server.
* The requests parameter is of type [InitializeParams](#InitializeParams)
* the response if of type [InitializeResult](#InitializeResult) of a Thenable that
* resolves to such.
*/
export namespace InitializeRequest {
export const type = new RequestType<InitializeParams, InitializeResult, InitializeError, void>('initialize');
}
/**
* The initialize parameters
*/
export interface _InitializeParams {
/**
* The process Id of the parent process that started
* the server.
*/
processId: number | null;
/**
* The rootPath of the workspace. Is null
* if no folder is open.
*
* @deprecated in favour of rootUri.
*/
rootPath?: string | null;
/**
* The rootUri of the workspace. Is null if no
* folder is open. If both `rootPath` and `rootUri` are set
* `rootUri` wins.
*
* @deprecated in favour of workspaceFolders.
*/
rootUri: string | null;