-
Notifications
You must be signed in to change notification settings - Fork 138
/
Copy pathprotocol.go
6750 lines (6310 loc) · 186 KB
/
protocol.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 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated (see typescript/README.md) DO NOT EDIT.
// Package protocol contains data types and code for LSP json rpcs
// generated automatically from vscode-languageserver-node
// commit: 696f9285bf849b73745682fdb1c1feac73eb8772
// last fetched Fri Apr 01 2022 10:53:41 GMT-0400 (Eastern Daylight Time)
package protocol
import "encoding/json"
/**
* A special text edit with an additional change annotation.
*
* @since 3.16.0.
*/
type AnnotatedTextEdit struct {
/**
* The actual identifier of the change annotation
*/
AnnotationID ChangeAnnotationIdentifier `json:"annotationId"`
TextEdit
}
/**
* The parameters passed via a apply workspace edit request.
*/
type ApplyWorkspaceEditParams struct {
/**
* An optional label of the workspace edit. This label is
* presented in the user interface for example on an undo
* stack to undo the workspace edit.
*/
Label string `json:"label,omitempty"`
/**
* The edits to apply.
*/
Edit WorkspaceEdit `json:"edit"`
}
/**
* The result returned from the apply workspace edit request.
*
* @since 3.17 renamed from ApplyWorkspaceEditResponse
*/
type ApplyWorkspaceEditResult struct {
/**
* Indicates whether the edit was applied or not.
*/
Applied bool `json:"applied"`
/**
* An optional textual description for why the edit was not applied.
* This may be used by the server for diagnostic logging or to provide
* a suitable error for a request that triggered the edit.
*/
FailureReason string `json:"failureReason,omitempty"`
/**
* Depending on the client's failure handling strategy `failedChange` might
* contain the index of the change that failed. This property is only available
* if the client signals a `failureHandlingStrategy` in its client capabilities.
*/
FailedChange uint32 `json:"failedChange,omitempty"`
}
/**
* @since 3.16.0
*/
type CallHierarchyClientCapabilities struct {
/**
* Whether implementation supports dynamic registration. If this is set to `true`
* the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
/**
* Represents an incoming call, e.g. a caller of a method or constructor.
*
* @since 3.16.0
*/
type CallHierarchyIncomingCall struct {
/**
* The item that makes the call.
*/
From CallHierarchyItem `json:"from"`
/**
* The ranges at which the calls appear. This is relative to the caller
* denoted by [`this.from`](#CallHierarchyIncomingCall.from).
*/
FromRanges []Range `json:"fromRanges"`
}
/**
* The parameter of a `callHierarchy/incomingCalls` request.
*
* @since 3.16.0
*/
type CallHierarchyIncomingCallsParams struct {
Item CallHierarchyItem `json:"item"`
WorkDoneProgressParams
PartialResultParams
}
/**
* Represents programming constructs like functions or constructors in the context
* of call hierarchy.
*
* @since 3.16.0
*/
type CallHierarchyItem struct {
/**
* The name of this item.
*/
Name string `json:"name"`
/**
* The kind of this item.
*/
Kind SymbolKind `json:"kind"`
/**
* Tags for this item.
*/
Tags []SymbolTag `json:"tags,omitempty"`
/**
* More detail for this item, e.g. the signature of a function.
*/
Detail string `json:"detail,omitempty"`
/**
* The resource identifier of this item.
*/
URI DocumentURI `json:"uri"`
/**
* The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.
*/
Range Range `json:"range"`
/**
* The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function.
* Must be contained by the [`range`](#CallHierarchyItem.range).
*/
SelectionRange Range `json:"selectionRange"`
/**
* A data entry field that is preserved between a call hierarchy prepare and
* incoming calls or outgoing calls requests.
*/
Data LSPAny `json:"data,omitempty"`
}
/**
* Call hierarchy options used during static registration.
*
* @since 3.16.0
*/
type CallHierarchyOptions struct {
WorkDoneProgressOptions
}
/**
* Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.
*
* @since 3.16.0
*/
type CallHierarchyOutgoingCall struct {
/**
* The item that is called.
*/
To CallHierarchyItem `json:"to"`
/**
* The range at which this item is called. This is the range relative to the caller, e.g the item
* passed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls)
* and not [`this.to`](#CallHierarchyOutgoingCall.to).
*/
FromRanges []Range `json:"fromRanges"`
}
/**
* The parameter of a `callHierarchy/outgoingCalls` request.
*
* @since 3.16.0
*/
type CallHierarchyOutgoingCallsParams struct {
Item CallHierarchyItem `json:"item"`
WorkDoneProgressParams
PartialResultParams
}
/**
* The parameter of a `textDocument/prepareCallHierarchy` request.
*
* @since 3.16.0
*/
type CallHierarchyPrepareParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
}
/**
* Call hierarchy options used during static or dynamic registration.
*
* @since 3.16.0
*/
type CallHierarchyRegistrationOptions struct {
TextDocumentRegistrationOptions
CallHierarchyOptions
StaticRegistrationOptions
}
type CancelParams struct {
/**
* The request id to cancel.
*/
ID interface{} /*number | string*/ `json:"id"`
}
/**
* Additional information that describes document changes.
*
* @since 3.16.0
*/
type ChangeAnnotation struct {
/**
* A human-readable string describing the actual change. The string
* is rendered prominent in the user interface.
*/
Label string `json:"label"`
/**
* A flag which indicates that user confirmation is needed
* before applying the change.
*/
NeedsConfirmation bool `json:"needsConfirmation,omitempty"`
/**
* A human-readable string which is rendered less prominent in
* the user interface.
*/
Description string `json:"description,omitempty"`
}
/**
* An identifier to refer to a change annotation stored with a workspace edit.
*/
type ChangeAnnotationIdentifier = string
type ClientCapabilities struct {
/**
* The workspace client capabilities
*/
Workspace Workspace3Gn `json:"workspace,omitempty"`
/**
* Text document specific client capabilities.
*/
TextDocument TextDocumentClientCapabilities `json:"textDocument,omitempty"`
/**
* Window specific client capabilities.
*/
Window struct {
/**
* Whether client supports server initiated progress using the
* `window/workDoneProgress/create` request.
*
* Since 3.15.0
*/
WorkDoneProgress bool `json:"workDoneProgress,omitempty"`
/**
* Capabilities specific to the showMessage request.
*
* @since 3.16.0
*/
ShowMessage ShowMessageRequestClientCapabilities `json:"showMessage,omitempty"`
/**
* Capabilities specific to the showDocument request.
*
* @since 3.16.0
*/
ShowDocument ShowDocumentClientCapabilities `json:"showDocument,omitempty"`
} `json:"window,omitempty"`
/**
* General client capabilities.
*
* @since 3.16.0
*/
General GeneralClientCapabilities `json:"general,omitempty"`
/**
* Experimental client capabilities.
*/
Experimental interface{} `json:"experimental,omitempty"`
}
/**
* A code action represents a change that can be performed in code, e.g. to fix a problem or
* to refactor code.
*
* A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed.
*/
type CodeAction struct {
/**
* A short, human-readable, title for this code action.
*/
Title string `json:"title"`
/**
* The kind of the code action.
*
* Used to filter code actions.
*/
Kind CodeActionKind `json:"kind,omitempty"`
/**
* The diagnostics that this code action resolves.
*/
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
/**
* Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted
* by keybindings.
*
* A quick fix should be marked preferred if it properly addresses the underlying error.
* A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
*
* @since 3.15.0
*/
IsPreferred bool `json:"isPreferred,omitempty"`
/**
* Marks that the code action cannot currently be applied.
*
* Clients should follow the following guidelines regarding disabled code actions:
*
* - Disabled code actions are not shown in automatic [lightbulb](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)
* code action menu.
*
* - Disabled actions are shown as faded out in the code action menu when the user request a more specific type
* of code action, such as refactorings.
*
* - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions)
* that auto applies a code action and only a disabled code actions are returned, the client should show the user an
* error message with `reason` in the editor.
*
* @since 3.16.0
*/
Disabled *struct {
/**
* Human readable description of why the code action is currently disabled.
*
* This is displayed in the code actions UI.
*/
Reason string `json:"reason"`
} `json:"disabled,omitempty"`
/**
* The workspace edit this code action performs.
*/
Edit WorkspaceEdit `json:"edit,omitempty"`
/**
* A command this code action executes. If a code action
* provides a edit and a command, first the edit is
* executed and then the command.
*/
Command *Command `json:"command,omitempty"`
/**
* A data entry field that is preserved on a code action between
* a `textDocument/codeAction` and a `codeAction/resolve` request.
*
* @since 3.16.0
*/
Data LSPAny `json:"data,omitempty"`
}
/**
* The Client Capabilities of a [CodeActionRequest](#CodeActionRequest).
*/
type CodeActionClientCapabilities struct {
/**
* Whether code action supports dynamic registration.
*/
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
/**
* The client support code action literals of type `CodeAction` as a valid
* response of the `textDocument/codeAction` request. If the property is not
* set the request can only return `Command` literals.
*
* @since 3.8.0
*/
CodeActionLiteralSupport struct {
/**
* The code action kind is support 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 support 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 th 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"`
}
/**
* Contains additional diagnostic information about the context in which
* a [code action](#CodeActionProvider.provideCodeActions) is run.
*/
type CodeActionContext struct {
/**
* An array of diagnostics known on the client side overlapping the range provided to the
* `textDocument/codeAction` request. They are provided so that the server knows which
* errors are currently presented to the user for the given range. There is no guarantee
* that these accurately reflect the error state of the resource. The primary parameter
* to compute code actions is the provided range.
*/
Diagnostics []Diagnostic `json:"diagnostics"`
/**
* Requested kind of actions to return.
*
* Actions not of this kind are filtered out by the client before being shown. So servers
* can omit computing them.
*/
Only []CodeActionKind `json:"only,omitempty"`
/**
* The reason why code actions were requested.
*
* @since 3.17.0
*/
TriggerKind CodeActionTriggerKind `json:"triggerKind,omitempty"`
}
/**
* A set of predefined code action kinds
*/
type CodeActionKind string
/**
* Provider options for a [CodeActionRequest](#CodeActionRequest).
*/
type CodeActionOptions struct {
/**
* 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 `json:"codeActionKinds,omitempty"`
/**
* The server provides support to resolve additional
* information for a code action.
*
* @since 3.16.0
*/
ResolveProvider bool `json:"resolveProvider,omitempty"`
WorkDoneProgressOptions
}
/**
* The parameters of a [CodeActionRequest](#CodeActionRequest).
*/
type CodeActionParams struct {
/**
* The document in which the command was invoked.
*/
TextDocument TextDocumentIdentifier `json:"textDocument"`
/**
* The range for which the command was invoked.
*/
Range Range `json:"range"`
/**
* Context carrying additional information.
*/
Context CodeActionContext `json:"context"`
WorkDoneProgressParams
PartialResultParams
}
/**
* The reason why code actions were requested.
*
* @since 3.17.0 - proposed state
*/
type CodeActionTriggerKind float64
/**
* Structure to capture a description for an error code.
*
* @since 3.16.0
*/
type CodeDescription struct {
/**
* An URI to open with more information about the diagnostic error.
*/
Href URI `json:"href"`
}
/**
* A code lens represents a [command](#Command) that should be shown along with
* source text, like the number of references, a way to run tests, etc.
*
* A code lens is _unresolved_ when no command is associated to it. For performance
* reasons the creation of a code lens and resolving should be done to two stages.
*/
type CodeLens struct {
/**
* The range in which this code lens is valid. Should only span a single line.
*/
Range Range `json:"range"`
/**
* The command this code lens represents.
*/
Command Command `json:"command,omitempty"`
/**
* A data entry field that is preserved on a code lens item between
* a [CodeLensRequest](#CodeLensRequest) and a [CodeLensResolveRequest]
* (#CodeLensResolveRequest)
*/
Data LSPAny `json:"data,omitempty"`
}
/**
* The client capabilities of a [CodeLensRequest](#CodeLensRequest).
*/
type CodeLensClientCapabilities struct {
/**
* Whether code lens supports dynamic registration.
*/
DynamicRegistration bool `json:"dynamicRegistration,omitempty"`
}
/**
* Code Lens provider options of a [CodeLensRequest](#CodeLensRequest).
*/
type CodeLensOptions struct {
/**
* Code lens has a resolve provider as well.
*/
ResolveProvider bool `json:"resolveProvider,omitempty"`
WorkDoneProgressOptions
}
/**
* The parameters of a [CodeLensRequest](#CodeLensRequest).
*/
type CodeLensParams struct {
/**
* The document to request code lens for.
*/
TextDocument TextDocumentIdentifier `json:"textDocument"`
WorkDoneProgressParams
PartialResultParams
}
/**
* @since 3.16.0
*/
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"`
}
/**
* Represents a color in RGBA space.
*/
type Color struct {
/**
* The red component of this color in the range [0-1].
*/
Red Decimal `json:"red"`
/**
* The green component of this color in the range [0-1].
*/
Green Decimal `json:"green"`
/**
* The blue component of this color in the range [0-1].
*/
Blue Decimal `json:"blue"`
/**
* The alpha component of this color in the range [0-1].
*/
Alpha Decimal `json:"alpha"`
}
/**
* Represents a color range from a document.
*/
type ColorInformation struct {
/**
* The range in the document where this color appears.
*/
Range Range `json:"range"`
/**
* The actual color value for this color range.
*/
Color Color `json:"color"`
}
type ColorPresentation struct {
/**
* The label of this color presentation. It will be shown on the color
* picker header. By default this is also the text that is inserted when selecting
* this color presentation.
*/
Label string `json:"label"`
/**
* An [edit](#TextEdit) which is applied to a document when selecting
* this presentation for the color. When `falsy` the [label](#ColorPresentation.label)
* is used.
*/
TextEdit TextEdit `json:"textEdit,omitempty"`
/**
* An optional array of additional [text edits](#TextEdit) that are applied when
* selecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves.
*/
AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`
}
/**
* Parameters for a [ColorPresentationRequest](#ColorPresentationRequest).
*/
type ColorPresentationParams struct {
/**
* The text document.
*/
TextDocument TextDocumentIdentifier `json:"textDocument"`
/**
* The color to request presentations for.
*/
Color Color `json:"color"`
/**
* The range where the color would be inserted. Serves as a context.
*/
Range Range `json:"range"`
WorkDoneProgressParams
PartialResultParams
}
/**
* Represents a reference to a command. Provides a title which
* will be used to represent a command in the UI and, optionally,
* an array of arguments which will be passed to the command handler
* function when invoked.
*/
type Command struct {
/**
* Title of the command, like `save`.
*/
Title string `json:"title"`
/**
* The identifier of the actual command handler.
*/
Command string `json:"command"`
/**
* Arguments that the command handler should be
* invoked with.
*/
Arguments []json.RawMessage `json:"arguments,omitempty"`
}
/**
* Completion client capabilities
*/
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 support 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 `details` 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"`
/**
* Defines how the client handles whitespace and indentation
* when accepting a completion item that uses multi line
* text in either `insertText` or `textEdit`.
*
* @since 3.17.0 - proposed state
*/
InsertTextMode InsertTextMode `json:"insertTextMode,omitempty"`
/**
* The client supports to send additional context information for a
* `textDocument/completion` request.
*/
ContextSupport bool `json:"contextSupport,omitempty"`
/**
* The client supports the following `CompletionList` specific
* capabilities.
*
* @since 3.17.0 - proposed state
*/
CompletionList struct {
/**
* The client supports the the following itemDefaults on
* a completion list.
*
* The value lists the supported property names of the
* `CompletionList.itemDefaults` object. If omitted
* no properties are supported.
*
* @since 3.17.0 - proposed state
*/
ItemDefaults []string `json:"itemDefaults,omitempty"`
} `json:"completionList,omitempty"`
}
/**
* Contains additional information about the context in which a completion request is triggered.
*/
type CompletionContext struct {
/**
* How the completion was triggered.
*/
TriggerKind CompletionTriggerKind `json:"triggerKind"`
/**
* The trigger character (a single character) that has trigger code complete.
* Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`
*/
TriggerCharacter string `json:"triggerCharacter,omitempty"`
}
/**
* A completion item represents a text snippet that is
* proposed to complete text that is being typed.
*/
type CompletionItem struct {
/**
* The label of this completion item.
*
* The label property is also by default the text that
* is inserted when selecting this completion.
*
* If label details are provided the label itself should
* be an unqualified name of the completion item.
*/
Label string `json:"label"`
/**
* Additional details for the label
*
* @since 3.17.0 - proposed state
*/
LabelDetails CompletionItemLabelDetails `json:"labelDetails,omitempty"`
/**
* The kind of this completion item. Based of the kind
* an icon is chosen by the editor.
*/
Kind CompletionItemKind `json:"kind,omitempty"`
/**
* Tags for this completion item.
*
* @since 3.15.0
*/
Tags []CompletionItemTag `json:"tags,omitempty"`
/**
* A human-readable string with additional information
* about this item, like type or symbol information.
*/
Detail string `json:"detail,omitempty"`
/**
* A human-readable string that represents a doc-comment.
*/
Documentation string/*string | MarkupContent*/ `json:"documentation,omitempty"`
/**
* Indicates if this item is deprecated.
* @deprecated Use `tags` instead.
*/
Deprecated bool `json:"deprecated,omitempty"`
/**
* Select this item when showing.
*
* *Note* that only one completion item can be selected and that the
* tool / client decides which item that is. The rule is that the *first*
* item of those that match best is selected.
*/
Preselect bool `json:"preselect,omitempty"`
/**
* A string that should be used when comparing this item
* with other items. When `falsy` the [label](#CompletionItem.label)
* is used.
*/
SortText string `json:"sortText,omitempty"`
/**
* A string that should be used when filtering a set of
* completion items. When `falsy` the [label](#CompletionItem.label)
* is used.
*/
FilterText string `json:"filterText,omitempty"`
/**
* A string that should be inserted into a document when selecting
* this completion. When `falsy` the [label](#CompletionItem.label)
* is used.
*
* The `insertText` is subject to interpretation by the client side.
* Some tools might not take the string literally. For example
* VS Code when code complete is requested in this example `con<cursor position>`
* and a completion item with an `insertText` of `console` is provided it
* will only insert `sole`. Therefore it is recommended to use `textEdit` instead
* since it avoids additional client side interpretation.
*/
InsertText string `json:"insertText,omitempty"`
/**
* The format of the insert text. The format applies to both the `insertText` property
* and the `newText` property of a provided `textEdit`. If omitted defaults to
* `InsertTextFormat.PlainText`.
*
* Please note that the insertTextFormat doesn't apply to `additionalTextEdits`.
*/
InsertTextFormat InsertTextFormat `json:"insertTextFormat,omitempty"`
/**
* How whitespace and indentation is handled during completion
* item insertion. If ignored the clients default value depends on
* the `textDocument.completion.insertTextMode` client capability.
*
* @since 3.16.0
*/
InsertTextMode InsertTextMode `json:"insertTextMode,omitempty"`
/**
* An [edit](#TextEdit) which is applied to a document when selecting
* this completion. When an edit is provided the value of
* [insertText](#CompletionItem.insertText) is ignored.
*
* Most editors support two different operation when accepting a completion item. One is to insert a
* completion text and the other is to replace an existing text with a completion text. Since this can
* usually not predetermined by a server it can report both ranges. Clients need to signal support for
* `InsertReplaceEdits` via the `textDocument.completion.insertReplaceSupport` client capability
* property.
*
* *Note 1:* The text edit's range as well as both ranges from a insert replace edit must be a
* [single line] and they must contain the position at which completion has been requested.
* *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range must be a prefix of
* the edit's replace range, that means it must be contained and starting at the same position.
*
* @since 3.16.0 additional type `InsertReplaceEdit`
*/
TextEdit *TextEdit/*TextEdit | InsertReplaceEdit*/ `json:"textEdit,omitempty"`
/**
* An optional array of additional [text edits](#TextEdit) that are applied when
* selecting this completion. Edits must not overlap (including the same insert position)
* with the main [edit](#CompletionItem.textEdit) nor with themselves.
*
* Additional text edits should be used to change text unrelated to the current cursor position
* (for example adding an import statement at the top of the file if the completion item will
* insert an unqualified type).
*/
AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`
/**
* An optional set of characters that when pressed while this completion is active will accept it first and
* then type that character. *Note* that all commit characters should have `length=1` and that superfluous
* characters will be ignored.
*/
CommitCharacters []string `json:"commitCharacters,omitempty"`
/**
* An optional [command](#Command) that is executed *after* inserting this completion. *Note* that
* additional modifications to the current document should be described with the
* [additionalTextEdits](#CompletionItem.additionalTextEdits)-property.
*/
Command *Command `json:"command,omitempty"`
/**
* A data entry field that is preserved on a completion item between a
* [CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest](#CompletionResolveRequest).
*/
Data LSPAny `json:"data,omitempty"`
}
/**
* The kind of a completion entry.