-
Notifications
You must be signed in to change notification settings - Fork 10
/
lsp_capabilities_client.go
1346 lines (1118 loc) · 49.2 KB
/
lsp_capabilities_client.go
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 2024 Cristian Maglie. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
package lsp
import (
"fmt"
"go.bug.st/json"
)
// ClientCapabilities Workspace specific client capabilities.
type ClientCapabilities struct {
Workspace *struct {
// The client supports applying batch edits
// to the workspace by supporting the request
// 'workspace/applyEdit'
ApplyEdit bool `json:"applyEdit,omitempty"`
// Capabilities specific to `WorkspaceEdit`s
WorkspaceEdit *WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"`
// Capabilities specific to the `workspace/didChangeConfiguration`
// notification.
DidChangeConfiguration *DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitempty"`
// Capabilities specific to the `workspace/didChangeWatchedFiles`
// notification.
DidChangeWatchedFiles *DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitempty"`
// Capabilities specific to the `workspace/symbol` request.
Symbol *WorkspaceSymbolClientCapabilities `json:"symbol,omitempty"`
// Capabilities specific to the `workspace/executeCommand` request.
ExecuteCommand *ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"`
// The client has support for workspace folders.
//
// @since 3.6.0
WorkspaceFolders bool `json:"workspaceFolders,omitempty"`
// The client supports `workspace/configuration` requests.
//
// @since 3.6.0
Configuration bool `json:"configuration,omitempty"`
// Capabilities specific to the semantic token requests scoped to the
// workspace.
//
// @since 3.16.0
SemanticTokens *SemanticTokensWorkspaceClientCapabilities `json:"semanticTokens,omitempty"`
// Capabilities specific to the code lens requests scoped to the
// workspace.
//
// @since 3.16.0
CodeLens *CodeLensWorkspaceClientCapabilities `json:"codeLens,omitempty"`
// The client has support for file requests/notifications.
//
// @since 3.16.0
FileOperations *struct {
// Whether the client supports dynamic registration for file
// requests/notifications.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// The client has support for sending didCreateFiles notifications.
DidCreate bool `json:"didCreate,omitempty"`
// The client has support for sending willCreateFiles requests.
WillCreate bool `json:"willCreate,omitempty"`
// The client has support for sending didRenameFiles notifications.
DidRename bool `json:"didRename,omitempty"`
// The client has support for sending willRenameFiles requests.
WillRename bool `json:"willRename,omitempty"`
// The client has support for sending didDeleteFiles notifications.
DidDelete bool `json:"didDelete,omitempty"`
// The client has support for sending willDeleteFiles requests.
WillDelete bool `json:"willDelete,omitempty"`
} `json:"fileOperations,omitempty"`
} `json:"workspace,omitempty"`
// Text document specific client capabilities.
TextDocument *TextDocumentClientCapabilities `json:"textDocument,omitempty"`
// Window specific client capabilities.
Window *struct {
// Whether client supports handling progress notifications. If set
// servers are allowed to report in `workDoneProgress` property in the
// request specific server capabilities.
//
// @since 3.15.0
WorkDoneProgress *bool `json:"workDoneProgress,omitempty"`
// Capabilities specific to the showMessage request
//
// @since 3.16.0
ShowMessage *ShowMessageRequestClientCapabilities `json:"showMessage,omitempty"`
// Client capabilities for the show document request.
//
// @since 3.16.0
ShowDocument *ShowDocumentClientCapabilities `json:"showDocument,omitempty"`
} `json:"window,omitempty"`
// General client capabilities.
//
// @since 3.16.0
General *struct {
// Client capability that signals how the client
// handles stale requests (e.g. a request
// for which the client will not process the response
// anymore since the information is outdated).
//
// @since 3.17.0
StaleRequestSupport *struct {
// The client will actively cancel the request.
Cancel bool `json:"cancel,required"`
// The list of requests for which the client
// will retry the request if it receives a
// response with error code `ContentModified``
RetryOnContentModified []string `json:"retryOnContentModified,required"`
} `json:"staleRequestSupport,omitempty"`
// Client capabilities specific to regular expressions.
//
// @since 3.16.0
RegularExpressions *RegularExpressionsClientCapabilities `json:"regularExpressions,omitempty"`
// Client capabilities specific to the client's markdown parser.
//
// @since 3.16.0
Markdown *MarkdownClientCapabilities `json:"markdown,omitempty"`
} `json:"general,omitempty"`
// Experimental client capabilities.
Experimental json.RawMessage `json:"experimental,omitempty"`
}
type WorkspaceEditClientCapabilities struct {
// The client supports versioned document changes in `WorkspaceEdit`s
DocumentChanges bool `json:"documentChanges,omitempty"`
// The resource operations the client supports. Clients should at least
// support 'create', 'rename' and 'delete' files and folders.
//
// @since 3.13.0
ResourceOperations []ResourceOperationKind `json:"resourceOperations,omitempty"`
// The failure handling strategy of a client if applying the workspace edit
// fails.
//
// @since 3.13.0
FailureHandling *FailureHandlingKind `json:"failureHandling,omitempty"`
// Whether the client normalizes line endings to the client specific
// setting.
// If set to `true` the client will normalize line ending characters
// in a workspace edit to the client specific new line character(s).
//
// @since 3.16.0
NormalizesLineEndings bool `json:"normalizesLineEndings,omitempty"`
// Whether the client in general supports change annotations on text edits,
// create file, rename file and delete file changes.
//
// @since 3.16.0
ChangeAnnotationSupport *struct {
// Whether the client groups edits with equal labels into tree nodes,
// for instance all edits labelled with "Changes in Strings" would
// be a tree node.
GroupsOnLabel bool `json:"groupsOnLabel,omitempty"`
} `json:"changeAnnotationSupport,omitempty"`
}
type ResourceOperationKind string
// ResourceOperationKindCreate Supports creating new files and folders.
const ResourceOperationKindCreate = ResourceOperationKind("create")
// ResourceOperationKindRename Supports renaming existing files and folders.
const ResourceOperationKindRename = ResourceOperationKind("rename")
// ResourceOperationKindDelete Supports deleting existing files and folders.
const ResourceOperationKindDelete = ResourceOperationKind("delete")
type FailureHandlingKind string
// FailureHandlingKindAbort Applying the workspace change is simply aborted if one of the changes
// provided fails. All operations executed before the failing operation
// stay executed.
const FailureHandlingKindAbort FailureHandlingKind = "abort"
// FailureHandlingKindTransactional All operations are executed transactional. That means they either all
// succeed or no changes at all are applied to the workspace.
const FailureHandlingKindTransactional FailureHandlingKind = "transactional"
// FailureHandlingKindTextOnlyTransactional 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.
const FailureHandlingKindTextOnlyTransactional FailureHandlingKind = "textOnlyTransactional"
// FailureHandlingKindUndo The client tries to undo the operations already executed. But there is no
// guarantee that this is succeeding.
const FailureHandlingKindUndo FailureHandlingKind = "undo"
type DidChangeConfigurationClientCapabilities struct {
// Did change configuration notification supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
type DidChangeWatchedFilesClientCapabilities struct {
// 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 bool `json:"dynamicRegistration,omitempty"`
}
type WorkspaceSymbolClientCapabilities struct {
// Symbol request supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// Specific capabilities for the `SymbolKind` in the `workspace/symbol`
// request.
SymbolKind *struct {
// 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 `json:"valueSet,omitempty"`
} `json:"symbolKind,omitempty"`
// The client supports tags on `SymbolInformation`.
// Clients supporting tags have to handle unknown tags gracefully.
//
// @since 3.16.0
TagSupport *struct {
// The tags supported by the client.
ValueSet []SymbolTag `json:"valueSet,omitempty"`
} `json:"tagSupport,omitempty"`
}
type SymbolKind int
const SymbolKindFile SymbolKind = 1
const SymbolKindModule SymbolKind = 2
const SymbolKindNamespace SymbolKind = 3
const SymbolKindPackage SymbolKind = 4
const SymbolKindClass SymbolKind = 5
const SymbolKindMethod SymbolKind = 6
const SymbolKindProperty SymbolKind = 7
const SymbolKindField SymbolKind = 8
const SymbolKindConstructor SymbolKind = 9
const SymbolKindEnum SymbolKind = 10
const SymbolKindInterface SymbolKind = 11
const SymbolKindFunction SymbolKind = 12
const SymbolKindVariable SymbolKind = 13
const SymbolKindConstant SymbolKind = 14
const SymbolKindString SymbolKind = 15
const SymbolKindNumber SymbolKind = 16
const SymbolKindBoolean SymbolKind = 17
const SymbolKindArray SymbolKind = 18
const SymbolKindObject SymbolKind = 19
const SymbolKindKey SymbolKind = 20
const SymbolKindNull SymbolKind = 21
const SymbolKindEnumMember SymbolKind = 22
const SymbolKindStruct SymbolKind = 23
const SymbolKindEvent SymbolKind = 24
const SymbolKindOperator SymbolKind = 25
const SymbolKindTypeParameter SymbolKind = 26
func (s SymbolKind) String() string {
switch s {
case SymbolKindFile:
return "SymbolKind:File"
case SymbolKindModule:
return "SymbolKind:Module"
case SymbolKindNamespace:
return "SymbolKind:Namespace"
case SymbolKindPackage:
return "SymbolKind:Package"
case SymbolKindClass:
return "SymbolKind:Class"
case SymbolKindMethod:
return "SymbolKind:Method"
case SymbolKindProperty:
return "SymbolKind:Property"
case SymbolKindField:
return "SymbolKind:Field"
case SymbolKindConstructor:
return "SymbolKind:Constructor"
case SymbolKindEnum:
return "SymbolKind:Enum"
case SymbolKindInterface:
return "SymbolKind:Interface"
case SymbolKindFunction:
return "SymbolKind:Function"
case SymbolKindVariable:
return "SymbolKind:Variable"
case SymbolKindConstant:
return "SymbolKind:Constant"
case SymbolKindString:
return "SymbolKind:String"
case SymbolKindNumber:
return "SymbolKind:Number"
case SymbolKindBoolean:
return "SymbolKind:Boolean"
case SymbolKindArray:
return "SymbolKind:Array"
case SymbolKindObject:
return "SymbolKind:Object"
case SymbolKindKey:
return "SymbolKind:Key"
case SymbolKindNull:
return "SymbolKind:Null"
case SymbolKindEnumMember:
return "SymbolKind:EnumMember"
case SymbolKindStruct:
return "SymbolKind:Struct"
case SymbolKindEvent:
return "SymbolKind:Event"
case SymbolKindOperator:
return "SymbolKind:Operator"
case SymbolKindTypeParameter:
return "SymbolKind:TypeParameter"
default:
return fmt.Sprintf("SymbolKind:%d", s)
}
}
type SymbolTag int
const SymbolTagDeprecated SymbolTag = 1
type ExecuteCommandClientCapabilities struct {
// Execute command supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
type SemanticTokensWorkspaceClientCapabilities struct {
// Whether the client implementation supports a refresh request sent from
// the server to the client.
//
// Note that this event is global and will force the client to refresh all
// semantic tokens currently shown. It should be used with absolute care
// and is useful for situation where a server for example detect a project
// wide change that requires such a calculation.
RefreshSupport bool `json:"refreshSupport,omitempty"`
}
type CodeLensWorkspaceClientCapabilities struct {
// Whether the client implementation supports a refresh request sent from the
// server to the client.
//
// Note that this event is global and will force the client to refresh all
// code lenses currently shown. It should be used with absolute care and is
// useful for situation where a server for example detect a project wide
// change that requires such a calculation.
RefreshSupport bool `json:"refreshSupport,omitempty"`
}
type TextDocumentClientCapabilities struct {
Synchronization *TextDocumentSyncClientCapabilities `json:"synchronization,omitempty"`
// Capabilities specific to the `textDocument/completion` request.
Completion *CompletionClientCapabilities `json:"completion,omitempty"`
// Capabilities specific to the `textDocument/hover` request.
Hover *HoverClientCapabilities `json:"hover,omitempty"`
// Capabilities specific to the `textDocument/signatureHelp` request.
SignatureHelp *SignatureHelpClientCapabilities `json:"signatureHelp,omitempty"`
// Capabilities specific to the `textDocument/declaration` request.
//
// @since 3.14.0
Declaration *DeclarationClientCapabilities `json:"declaration,omitempty"`
// Capabilities specific to the `textDocument/definition` request.
Definition *DefinitionClientCapabilities `json:"definition,omitempty"`
// Capabilities specific to the `textDocument/typeDefinition` request.
//
// @since 3.6.0
TypeDefinition *TypeDefinitionClientCapabilities `json:"typeDefinition,omitempty"`
// Capabilities specific to the `textDocument/implementation` request.
//
// @since 3.6.0
Implementation *ImplementationClientCapabilities `json:"implementation,omitempty"`
// Capabilities specific to the `textDocument/references` request.
References *ReferenceClientCapabilities `json:"references,omitempty"`
// Capabilities specific to the `textDocument/documentHighlight` request.
DocumentHighlight *DocumentHighlightClientCapabilities `json:"documentHighlight,omitempty"`
// Capabilities specific to the `textDocument/documentSymbol` request.
DocumentSymbol *DocumentSymbolClientCapabilities `json:"documentSymbol,omitempty"`
// Capabilities specific to the `textDocument/codeAction` request.
CodeAction *CodeActionClientCapabilities `json:"codeAction,omitempty"`
// Capabilities specific to the `textDocument/codeLens` request.
CodeLens *CodeLensClientCapabilities `json:"codeLens,omitempty"`
// Capabilities specific to the `textDocument/documentLink` request.
DocumentLink *DocumentLinkClientCapabilities `json:"documentLink,omitempty"`
// Capabilities specific to the `textDocument/documentColor` and the
// `textDocument/colorPresentation` request.
//
// @since 3.6.0
ColorProvider *DocumentColorClientCapabilities `json:"colorProvider,omitempty"`
// Capabilities specific to the `textDocument/formatting` request.
Formatting *DocumentFormattingClientCapabilities `json:"formatting,omitempty"`
// Capabilities specific to the `textDocument/rangeFormatting` request.
RangeFormatting *DocumentRangeFormattingClientCapabilities `json:"rangeFormatting,omitempty"`
// Capabilities specific to the `textDocument/onTypeFormatting` request.
OnTypeFormatting *DocumentOnTypeFormattingClientCapabilities `json:"onTypeFormatting,omitempty"`
// Capabilities specific to the `textDocument/rename` request.
Rename *RenameClientCapabilities `json:"rename,omitempty"`
// Capabilities specific to the `textDocument/publishDiagnostics`
// notification.
PublishDiagnostics *PublishDiagnosticsClientCapabilities `json:"publishDiagnostics,omitempty"`
// Capabilities specific to the `textDocument/foldingRange` request.
//
// @since 3.10.0
FoldingRange *FoldingRangeClientCapabilities `json:"foldingRange,omitempty"`
// Capabilities specific to the `textDocument/selectionRange` request.
//
// @since 3.15.0
SelectionRange *SelectionRangeClientCapabilities `json:"selectionRange,omitempty"`
// Capabilities specific to the `textDocument/linkedEditingRange` request.
//
// @since 3.16.0
LinkedEditingRange *LinkedEditingRangeClientCapabilities `json:"linkedEditingRange,omitempty"`
// Capabilities specific to the various call hierarchy requests.
//
// @since 3.16.0
CallHierarchy *CallHierarchyClientCapabilities `json:"callHierarchy,omitempty"`
// Capabilities specific to the various semantic token requests.
//
// @since 3.16.0
SemanticTokens *SemanticTokensClientCapabilities `json:"semanticTokens,omitempty"`
// Capabilities specific to the `textDocument/moniker` request.
//
// @since 3.16.0
Moniker *MonikerClientCapabilities `json:"moniker,omitempty"`
}
type TextDocumentSyncClientCapabilities struct {
// Whether text document synchronization supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// The client supports sending will save notifications.
WillSave bool `json:"willSave,omitempty"`
// 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 bool `json:"willSaveWaitUntil,omitempty"`
// The client supports did save notifications.
DidSave bool `json:"didSave,omitempty"`
}
type CompletionKindCapabilities struct {
// Whether completion supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// The client supports the following `CompletionItem` specific
// capabilities.
CompletionItem *struct {
// 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 bool `json:"snippetSupport,omitempty"`
// Client supports commit characters on a completion item.
CommitCharactersSupport bool `json:"commitCharactersSupport,omitempty"`
// Client supports the follow content formats for the documentation
// property. The order describes the preferred format of the client.
DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`
// Client supports the deprecated property on a completion item.
DeprecatedSupport bool `json:"deprecatedSupport,omitempty"`
// Client supports the preselect property on a completion item.
PreselectSupport bool `json:"preselectSupport,omitempty"`
// Client supports the tag property on a completion item. Clients
// supporting tags have to handle unknown tags gracefully. Clients
// especially need to preserve unknown tags when sending a completion
// item back to the server in a resolve call.
//
// @since 3.15.0
TagSupport *struct {
// The tags supported by the client.
ValueSet []CompletionItemTag `json:"valueSet"`
} `json:"tagSupport,omitempty"`
// Client supports insert replace edit to control different behavior if
// a completion item is inserted in the text or should replace text.
//
// @since 3.16.0
InsertReplaceSupport bool `json:"insertReplaceSupport,omitempty"`
// Indicates which properties a client can resolve lazily on a
// completion item. Before version 3.16.0 only the predefined properties
// `documentation` and `detail` could be resolved lazily.
//
// @since 3.16.0
ResolveSupport *struct {
// The properties that a client can resolve lazily.
Properties []string `json:"properties"`
} `json:"resolveSupport,omitempty"`
// The client supports the `insertTextMode` property on
// a completion item to override the whitespace handling mode
// as defined by the client (see `insertTextMode`).
//
// @since 3.16.0
InsertTextModeSupport *struct {
ValueSet []InsertTextMode `json:"valueSet"`
} `json:"insertTextModeSupport,omitempty"`
// The client has support for completion item label
// details (see also `CompletionItemLabelDetails`).
//
// @since 3.17.0 - proposed state
LabelDetailsSupport bool `json:"labelDetailsSupport,omitempty"`
} `json:"completionItem,omitempty"`
CompletionItemKind *struct {
// 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 `json:"valueSet,omitempty"`
} `json:"completionItemKind,omitempty"`
// The client supports to send additional context information for a
// `textDocument/completion` request.
ContextSupport bool `json:"contextSupport,omitempty"`
// The client's default when the completion item doesn't provide a
// `insertTextMode` property.
//
// @since 3.17.0
InsertTextMode *InsertTextMode `json:"insertTextMode,omitempty"`
}
type MarkupKind string
// MarkupKindPlainText Plain text is supported as a content format
const MarkupKindPlainText MarkupKind = "plaintext"
// MarkupKindMarkdown Markdown is supported as a content format
const MarkupKindMarkdown MarkupKind = "markdown"
// CompletionItemTag Completion item tags are extra annotations that tweak the rendering of a
// completion item.
//
// @since 3.15.0
type CompletionItemTag int
// CompletionItemTagDeprecated Render a completion as obsolete, usually using a strike-out.
const CompletionItemTagDeprecated CompletionItemTag = 1
// InsertTextMode How whitespace and indentation is handled during completion
// item insertion.
//
// @since 3.16.0
type InsertTextMode int
// InsertTextModeAsIs 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.
const InsertTextModeAsIs InsertTextMode = 1
// InsertTextModeAdjustIndentation 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.
const InsertTextModeAdjustIndentation InsertTextMode = 2
// CompletionItemKind The kind of a completion entry.
type CompletionItemKind int
const CompletionItemKindText CompletionItemKind = 1
const CompletionItemKindMethod CompletionItemKind = 2
const CompletionItemKindFunction CompletionItemKind = 3
const CompletionItemKindConstructor CompletionItemKind = 4
const CompletionItemKindField CompletionItemKind = 5
const CompletionItemKindVariable CompletionItemKind = 6
const CompletionItemKindClass CompletionItemKind = 7
const CompletionItemKindInterface CompletionItemKind = 8
const CompletionItemKindModule CompletionItemKind = 9
const CompletionItemKindProperty CompletionItemKind = 10
const CompletionItemKindUnit CompletionItemKind = 11
const CompletionItemKindValue CompletionItemKind = 12
const CompletionItemKindEnum CompletionItemKind = 13
const CompletionItemKindKeyword CompletionItemKind = 14
const CompletionItemKindSnippet CompletionItemKind = 15
const CompletionItemKindColor CompletionItemKind = 16
const CompletionItemKindFile CompletionItemKind = 17
const CompletionItemKindReference CompletionItemKind = 18
const CompletionItemKindFolder CompletionItemKind = 19
const CompletionItemKindEnumMember CompletionItemKind = 20
const CompletionItemKindConstant CompletionItemKind = 21
const CompletionItemKindStruct CompletionItemKind = 22
const CompletionItemKindEvent CompletionItemKind = 23
const CompletionItemKindOperator CompletionItemKind = 24
const CompletionItemKindTypeParameter CompletionItemKind = 25
type CompletionClientCapabilities struct {
// Whether completion supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// The client supports the following `CompletionItem` specific
// capabilities.
CompletionItem *struct {
// 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 bool `json:"snippetSupport,omitempty"`
// Client supports commit characters on a completion item.
CommitCharactersSupport bool `json:"commitCharactersSupport,omitempty"`
// Client supports the follow content formats for the documentation
// property. The order describes the preferred format of the client.
DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`
// Client supports the deprecated property on a completion item.
DeprecatedSupport bool `json:"deprecatedSupport,omitempty"`
// Client supports the preselect property on a completion item.
PreselectSupport bool `json:"preselectSupport,omitempty"`
// Client supports the tag property on a completion item. Clients
// supporting tags have to handle unknown tags gracefully. Clients
// especially need to preserve unknown tags when sending a completion
// item back to the server in a resolve call.
//
// @since 3.15.0
TagSupport *struct {
// The tags supported by the client.
ValueSet []CompletionItemTag `json:"valueSet"`
} `json:"tagSupport,omitempty"`
// Client supports insert replace edit to control different behavior if
// a completion item is inserted in the text or should replace text.
//
// @since 3.16.0
InsertReplaceSupport bool `json:"insertReplaceSupport,omitempty"`
// Indicates which properties a client can resolve lazily on a
// completion item. Before version 3.16.0 only the predefined properties
// `documentation` and `detail` could be resolved lazily.
//
// @since 3.16.0
ResolveSupport *struct {
// The properties that a client can resolve lazily.
Properties []string `json:"properties"`
} `json:"resolveSupport,omitempty"`
// The client supports the `insertTextMode` property on
// a completion item to override the whitespace handling mode
// as defined by the client (see `insertTextMode`).
//
// @since 3.16.0
InsertTextModeSupport *struct {
ValueSet []InsertTextMode `json:"valueSet"`
} `json:"insertTextModeSupport,omitempty"`
// The client has support for completion item label
// details (see also `CompletionItemLabelDetails`).
//
// @since 3.17.0 - proposed state
LabelDetailsSupport bool `json:"labelDetailsSupport,omitempty"`
} `json:"completionItem,omitempty"`
CompletionItemKind *struct {
// 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 `json:"valueSet,omitempty"`
} `json:"completionItemKind,omitempty"`
// The client supports to send additional context information for a
// `textDocument/completion` request.
ContextSupport bool `json:"contextSupport,omitempty"`
// The client's default when the completion item doesn't provide a
// `insertTextMode` property.
//
// @since 3.17.0
InsertTextMode *InsertTextMode `json:"insertTextMode,omitempty"`
}
type HoverClientCapabilities struct {
// Whether hover supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// Client supports the follow content formats if the content
// property refers to a `literal of type MarkupContent`.
// The order describes the preferred format of the client.
ContentFormat []MarkupKind `json:"contentFormat,omitempty"`
}
type SignatureHelpClientCapabilities struct {
// Whether signature help supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// The client supports the following `SignatureInformation`
// specific properties.
SignatureInformation *struct {
// Client supports the follow content formats for the documentation
// property. The order describes the preferred format of the client.
DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`
// Client capabilities specific to parameter information.
ParameterInformation *struct {
// The client supports processing label offsets instead of a
// simple label string.
//
// @since 3.14.0
LabelOffsetSupport bool `json:"labelOffsetSupport,omitempty"`
} `json:"parameterInformation,omitempty"`
// The client supports the `activeParameter` property on
// `SignatureInformation` literal.
//
// @since 3.16.0
ActiveParameterSupport bool `json:"activeParameterSupport,omitempty"`
} `json:"signatureInformation,omitempty"`
// The client supports to send additional context information for a
// `textDocument/signatureHelp` request. A client that opts into
// contextSupport will also support the `retriggerCharacters` on
// `SignatureHelpOptions`.
//
// @since 3.15.0
ContextSupport bool `json:"contextSupport,omitempty"`
}
type DeclarationClientCapabilities struct {
// Whether declaration supports dynamic registration. If this is set to
// `true` the client supports the new `DeclarationRegistrationOptions`
// return value for the corresponding server capability as well.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// The client supports additional metadata in the form of declaration links.
LinkSupport bool `json:"linkSupport,omitempty"`
}
type DefinitionClientCapabilities struct {
// Whether definition supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// The client supports additional metadata in the form of definition links.
//
// @since 3.14.0
LinkSupport bool `json:"linkSupport,omitempty"`
}
type TypeDefinitionClientCapabilities struct {
// Whether implementation supports dynamic registration. If this is set to
// `true` the client supports the new `TypeDefinitionRegistrationOptions`
// return value for the corresponding server capability as well.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// The client supports additional metadata in the form of definition links.
//
// @since 3.14.0
LinkSupport bool `json:"linkSupport,omitempty"`
}
type ImplementationClientCapabilities struct {
// Whether implementation supports dynamic registration. If this is set to
// `true` the client supports the new `ImplementationRegistrationOptions`
// return value for the corresponding server capability as well.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// The client supports additional metadata in the form of definition links.
//
// @since 3.14.0
LinkSupport bool `json:"linkSupport,omitempty"`
}
type ReferenceClientCapabilities struct {
// Whether references supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
type DocumentHighlightClientCapabilities struct {
// Whether document highlight supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
type DocumentSymbolClientCapabilities struct {
// Whether document symbol supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// Specific capabilities for the `SymbolKind` in the
// `textDocument/documentSymbol` request.
SymbolKind *struct {
// 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 `json:"valueSet,omitempty"`
} `json:"symbolKind,omitempty"`
// The client supports hierarchical document symbols.
HierarchicalDocumentSymbolSupport bool `json:"hierarchicalDocumentSymbolSupport,omitempty"`
// The client supports tags on `SymbolInformation`. Tags are supported on
// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true.
// Clients supporting tags have to handle unknown tags gracefully.
//
// @since 3.16.0
TagSupport *struct {
// The tags supported by the client.
ValueSet []SymbolTag `json:"valueSet"`
} `json:"tagSupport,omitempty"`
// The client supports an additional label presented in the UI when
// registering a document symbol provider.
//
// @since 3.16.0
LabelSupport bool `json:"labelSupport,omitempty"`
}
type CodeActionClientCapabilities struct {
// Whether code action supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// The client supports code action literals as a valid
// response of the `textDocument/codeAction` request.
//
// @since 3.8.0
CodeActionLiteralSupport *struct {
// The code action kind is supported with the following value
// set.
CodeActionKind struct {
// 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 `json:"valueSet"`
} `json:"codeActionKind"`
} `json:"codeActionLiteralSupport,omitempty"`
// Whether code action supports the `isPreferred` property.
//
// @since 3.15.0
IsPreferredSupport bool `json:"isPreferredSupport,omitempty"`
// Whether code action supports the `disabled` property.
//
// @since 3.16.0
DisabledSupport bool `json:"disabledSupport,omitempty"`
// Whether code action supports the `data` property which is
// preserved between a `textDocument/codeAction` and a
// `codeAction/resolve` request.
//
// @since 3.16.0
DataSupport bool `json:"dataSupport,omitempty"`
// Whether the client supports resolving additional code action
// properties via a separate `codeAction/resolve` request.
//
// @since 3.16.0
ResolveSupport *struct {
// The properties that a client can resolve lazily.
Properties []string `json:"properties"`
} `json:"resolveSupport,omitempty"`
// Whether the client honors the change annotations in
// text edits and resource operations returned via the
// `CodeAction#edit` property by for example presenting
// the workspace edit in the user interface and asking
// for confirmation.
//
// @since 3.16.0
HonorsChangeAnnotations bool `json:"honorsChangeAnnotations,omitempty"`
}
type CodeLensClientCapabilities struct {
// Whether code lens supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
type DocumentLinkClientCapabilities struct {
// Whether document link supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// Whether the client supports the `tooltip` property on `DocumentLink`.
//
// @since 3.15.0
TooltipSupport bool `json:"tooltipSupport,omitempty"`
}
type DocumentColorClientCapabilities struct {
// Whether document color supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
type DocumentFormattingClientCapabilities struct {
// Whether formatting supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
type DocumentRangeFormattingClientCapabilities struct {
// Whether formatting supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
type DocumentOnTypeFormattingClientCapabilities struct {
// Whether on type formatting supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
type RenameClientCapabilities struct {
// Whether rename supports dynamic registration.
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
// Client supports testing for validity of rename operations
// before execution.
//
// @since version 3.12.0
PrepareSupport bool `json:"prepareSupport,omitempty"`
// Client supports the default behavior result
// (`{ defaultBehavior: boolean }`).
//
// The value indicates the default behavior used by the
// client.
//
// @since version 3.16.0
PrepareSupportDefaultBehavior *PrepareSupportDefaultBehavior `json:"prepareSupportDefaultBehavior,omitempty"`
// Whether th client honors the change annotations in
// text edits and resource operations returned via the