-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathbasic_structures.gen.go
More file actions
1261 lines (1099 loc) · 48.1 KB
/
Copy pathbasic_structures.gen.go
File metadata and controls
1261 lines (1099 loc) · 48.1 KB
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 2026 The Go Language Server Authors
// SPDX-License-Identifier: BSD-3-Clause
// Code generated by internal/genlsp from metaModel.json; DO NOT EDIT.
package protocol
import (
"go.lsp.dev/uri"
)
// ErrorCodes Predefined error codes.
type ErrorCodes int32
// ErrorCodes enumeration values.
const (
// ErrorCodesParseError is defined by the LSP specification.
ErrorCodesParseError ErrorCodes = -32700
// ErrorCodesInvalidRequest is defined by the LSP specification.
ErrorCodesInvalidRequest ErrorCodes = -32600
// ErrorCodesMethodNotFound is defined by the LSP specification.
ErrorCodesMethodNotFound ErrorCodes = -32601
// ErrorCodesInvalidParams is defined by the LSP specification.
ErrorCodesInvalidParams ErrorCodes = -32602
// ErrorCodesInternalError is defined by the LSP specification.
ErrorCodesInternalError ErrorCodes = -32603
// ErrorCodesServerNotInitialized Error code indicating that a server received a notification or
// request before the server has received the `initialize` request.
ErrorCodesServerNotInitialized ErrorCodes = -32002
// ErrorCodesUnknownErrorCode is defined by the LSP specification.
ErrorCodesUnknownErrorCode ErrorCodes = -32001
)
// LSPErrorCodes is defined by the LSP specification.
type LSPErrorCodes int32
// LSPErrorCodes enumeration values.
const (
// LSPErrorCodesRequestFailed A request failed but it was syntactically correct, e.g the
// method name was known and the parameters were valid. The error
// message should contain human readable information about why
// the request failed.
//
// Since: 3.17.0
LSPErrorCodesRequestFailed LSPErrorCodes = -32803
// LSPErrorCodesServerCancelled The server cancelled the request. This error code should
// only be used for requests that explicitly support being
// server cancellable.
//
// Since: 3.17.0
LSPErrorCodesServerCancelled LSPErrorCodes = -32802
// LSPErrorCodesContentModified The server detected that the content of a document got
// modified outside normal conditions. A server should
// NOT send this error code if it detects a content change
// in it unprocessed messages. The result even computed
// on an older state might still be useful for the client.
//
// If a client decides that a result is not of any use anymore
// the client should cancel the request.
LSPErrorCodesContentModified LSPErrorCodes = -32801
// LSPErrorCodesRequestCancelled The client has canceled a request and a server has detected
// the cancel.
LSPErrorCodesRequestCancelled LSPErrorCodes = -32800
)
// SymbolKind A symbol kind.
type SymbolKind uint32
// SymbolKind enumeration values.
const (
// SymbolKindFile is defined by the LSP specification.
SymbolKindFile SymbolKind = 1
// SymbolKindModule is defined by the LSP specification.
SymbolKindModule SymbolKind = 2
// SymbolKindNamespace is defined by the LSP specification.
SymbolKindNamespace SymbolKind = 3
// SymbolKindPackage is defined by the LSP specification.
SymbolKindPackage SymbolKind = 4
// SymbolKindClass is defined by the LSP specification.
SymbolKindClass SymbolKind = 5
// SymbolKindMethod is defined by the LSP specification.
SymbolKindMethod SymbolKind = 6
// SymbolKindProperty is defined by the LSP specification.
SymbolKindProperty SymbolKind = 7
// SymbolKindField is defined by the LSP specification.
SymbolKindField SymbolKind = 8
// SymbolKindConstructor is defined by the LSP specification.
SymbolKindConstructor SymbolKind = 9
// SymbolKindEnum is defined by the LSP specification.
SymbolKindEnum SymbolKind = 10
// SymbolKindInterface is defined by the LSP specification.
SymbolKindInterface SymbolKind = 11
// SymbolKindFunction is defined by the LSP specification.
SymbolKindFunction SymbolKind = 12
// SymbolKindVariable is defined by the LSP specification.
SymbolKindVariable SymbolKind = 13
// SymbolKindConstant is defined by the LSP specification.
SymbolKindConstant SymbolKind = 14
// SymbolKindString is defined by the LSP specification.
SymbolKindString SymbolKind = 15
// SymbolKindNumber is defined by the LSP specification.
SymbolKindNumber SymbolKind = 16
// SymbolKindBoolean is defined by the LSP specification.
SymbolKindBoolean SymbolKind = 17
// SymbolKindArray is defined by the LSP specification.
SymbolKindArray SymbolKind = 18
// SymbolKindObject is defined by the LSP specification.
SymbolKindObject SymbolKind = 19
// SymbolKindKey is defined by the LSP specification.
SymbolKindKey SymbolKind = 20
// SymbolKindNull is defined by the LSP specification.
SymbolKindNull SymbolKind = 21
// SymbolKindEnumMember is defined by the LSP specification.
SymbolKindEnumMember SymbolKind = 22
// SymbolKindStruct is defined by the LSP specification.
SymbolKindStruct SymbolKind = 23
// SymbolKindEvent is defined by the LSP specification.
SymbolKindEvent SymbolKind = 24
// SymbolKindOperator is defined by the LSP specification.
SymbolKindOperator SymbolKind = 25
// SymbolKindTypeParameter is defined by the LSP specification.
SymbolKindTypeParameter SymbolKind = 26
)
// SymbolTag Symbol tags are extra annotations that tweak the rendering of a symbol.
//
// Since: 3.16
type SymbolTag uint32
// SymbolTag enumeration values.
const (
// SymbolTagDeprecated Render a symbol as obsolete, usually using a strike-out.
SymbolTagDeprecated SymbolTag = 1
)
// TraceValue is defined by the LSP specification.
type TraceValue string
// TraceValue enumeration values.
const (
// TraceValueOff Turn tracing off.
TraceValueOff TraceValue = "off"
// TraceValueMessages Trace messages only.
TraceValueMessages TraceValue = "messages"
// TraceValueVerbose Verbose message tracing.
TraceValueVerbose TraceValue = "verbose"
)
// MarkupKind Describes the content type that a client supports in various
// result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
//
// Please note that `MarkupKinds` must not start with a `$`. This kinds
// are reserved for internal usage.
type MarkupKind string
// MarkupKind enumeration values.
const (
// MarkupKindPlainText Plain text is supported as a content format
MarkupKindPlainText MarkupKind = "plaintext"
// MarkupKindMarkdown Markdown is supported as a content format
MarkupKindMarkdown MarkupKind = "markdown"
)
// LanguageKind Predefined Language kinds
//
// Since: 3.18.0
type LanguageKind string
// LanguageKind enumeration values.
const (
// LanguageKindABAP is defined by the LSP specification.
LanguageKindABAP LanguageKind = "abap"
// LanguageKindWindowsBat is defined by the LSP specification.
LanguageKindWindowsBat LanguageKind = "bat"
// LanguageKindBibTeX is defined by the LSP specification.
LanguageKindBibTeX LanguageKind = "bibtex"
// LanguageKindClojure is defined by the LSP specification.
LanguageKindClojure LanguageKind = "clojure"
// LanguageKindCoffeescript is defined by the LSP specification.
LanguageKindCoffeescript LanguageKind = "coffeescript"
// LanguageKindC is defined by the LSP specification.
LanguageKindC LanguageKind = "c"
// LanguageKindCPP is defined by the LSP specification.
LanguageKindCPP LanguageKind = "cpp"
// LanguageKindCSharp is defined by the LSP specification.
LanguageKindCSharp LanguageKind = "csharp"
// LanguageKindCSS is defined by the LSP specification.
LanguageKindCSS LanguageKind = "css"
// LanguageKindD is defined by the LSP specification.
//
// Since: 3.18.0
LanguageKindD LanguageKind = "d"
// LanguageKindDelphi is defined by the LSP specification.
//
// Since: 3.18.0
LanguageKindDelphi LanguageKind = "pascal"
// LanguageKindDiff is defined by the LSP specification.
LanguageKindDiff LanguageKind = "diff"
// LanguageKindDart is defined by the LSP specification.
LanguageKindDart LanguageKind = "dart"
// LanguageKindDockerfile is defined by the LSP specification.
LanguageKindDockerfile LanguageKind = "dockerfile"
// LanguageKindElixir is defined by the LSP specification.
LanguageKindElixir LanguageKind = "elixir"
// LanguageKindErlang is defined by the LSP specification.
LanguageKindErlang LanguageKind = "erlang"
// LanguageKindFSharp is defined by the LSP specification.
LanguageKindFSharp LanguageKind = "fsharp"
// LanguageKindGitCommit is defined by the LSP specification.
LanguageKindGitCommit LanguageKind = "git-commit"
// LanguageKindGitRebase is defined by the LSP specification.
LanguageKindGitRebase LanguageKind = "git-rebase"
// LanguageKindGo is defined by the LSP specification.
LanguageKindGo LanguageKind = "go"
// LanguageKindGroovy is defined by the LSP specification.
LanguageKindGroovy LanguageKind = "groovy"
// LanguageKindHandlebars is defined by the LSP specification.
LanguageKindHandlebars LanguageKind = "handlebars"
// LanguageKindHaskell is defined by the LSP specification.
LanguageKindHaskell LanguageKind = "haskell"
// LanguageKindHTML is defined by the LSP specification.
LanguageKindHTML LanguageKind = "html"
// LanguageKindIni is defined by the LSP specification.
LanguageKindIni LanguageKind = "ini"
// LanguageKindJava is defined by the LSP specification.
LanguageKindJava LanguageKind = "java"
// LanguageKindJavaScript is defined by the LSP specification.
LanguageKindJavaScript LanguageKind = "javascript"
// LanguageKindJavaScriptReact is defined by the LSP specification.
LanguageKindJavaScriptReact LanguageKind = "javascriptreact"
// LanguageKindJSON is defined by the LSP specification.
LanguageKindJSON LanguageKind = "json"
// LanguageKindLaTeX is defined by the LSP specification.
LanguageKindLaTeX LanguageKind = "latex"
// LanguageKindLess is defined by the LSP specification.
LanguageKindLess LanguageKind = "less"
// LanguageKindLua is defined by the LSP specification.
LanguageKindLua LanguageKind = "lua"
// LanguageKindMakefile is defined by the LSP specification.
LanguageKindMakefile LanguageKind = "makefile"
// LanguageKindMarkdown is defined by the LSP specification.
LanguageKindMarkdown LanguageKind = "markdown"
// LanguageKindObjectiveC is defined by the LSP specification.
LanguageKindObjectiveC LanguageKind = "objective-c"
// LanguageKindObjectiveCPP is defined by the LSP specification.
LanguageKindObjectiveCPP LanguageKind = "objective-cpp"
// LanguageKindPascal is defined by the LSP specification.
//
// Since: 3.18.0
LanguageKindPascal LanguageKind = "pascal"
// LanguageKindPerl is defined by the LSP specification.
LanguageKindPerl LanguageKind = "perl"
// LanguageKindPerl6 is defined by the LSP specification.
LanguageKindPerl6 LanguageKind = "perl6"
// LanguageKindPHP is defined by the LSP specification.
LanguageKindPHP LanguageKind = "php"
// LanguageKindPlaintext is defined by the LSP specification.
LanguageKindPlaintext LanguageKind = "plaintext"
// LanguageKindPowershell is defined by the LSP specification.
LanguageKindPowershell LanguageKind = "powershell"
// LanguageKindPug is defined by the LSP specification.
LanguageKindPug LanguageKind = "jade"
// LanguageKindPython is defined by the LSP specification.
LanguageKindPython LanguageKind = "python"
// LanguageKindR is defined by the LSP specification.
LanguageKindR LanguageKind = "r"
// LanguageKindRazor is defined by the LSP specification.
LanguageKindRazor LanguageKind = "razor"
// LanguageKindRuby is defined by the LSP specification.
LanguageKindRuby LanguageKind = "ruby"
// LanguageKindRust is defined by the LSP specification.
LanguageKindRust LanguageKind = "rust"
// LanguageKindSCSS is defined by the LSP specification.
LanguageKindSCSS LanguageKind = "scss"
// LanguageKindSASS is defined by the LSP specification.
LanguageKindSASS LanguageKind = "sass"
// LanguageKindScala is defined by the LSP specification.
LanguageKindScala LanguageKind = "scala"
// LanguageKindShaderLab is defined by the LSP specification.
LanguageKindShaderLab LanguageKind = "shaderlab"
// LanguageKindShellScript is defined by the LSP specification.
LanguageKindShellScript LanguageKind = "shellscript"
// LanguageKindSQL is defined by the LSP specification.
LanguageKindSQL LanguageKind = "sql"
// LanguageKindSwift is defined by the LSP specification.
LanguageKindSwift LanguageKind = "swift"
// LanguageKindTypeScript is defined by the LSP specification.
LanguageKindTypeScript LanguageKind = "typescript"
// LanguageKindTypeScriptReact is defined by the LSP specification.
LanguageKindTypeScriptReact LanguageKind = "typescriptreact"
// LanguageKindTeX is defined by the LSP specification.
LanguageKindTeX LanguageKind = "tex"
// LanguageKindVisualBasic is defined by the LSP specification.
LanguageKindVisualBasic LanguageKind = "vb"
// LanguageKindXML is defined by the LSP specification.
LanguageKindXML LanguageKind = "xml"
// LanguageKindXSL is defined by the LSP specification.
LanguageKindXSL LanguageKind = "xsl"
// LanguageKindYAML is defined by the LSP specification.
LanguageKindYAML LanguageKind = "yaml"
)
// PositionEncodingKind A set of predefined position encoding kinds.
//
// Since: 3.17.0
type PositionEncodingKind string
// PositionEncodingKind enumeration values.
const (
// PositionEncodingKindUTF8 Character offsets count UTF-8 code units (e.g. bytes).
PositionEncodingKindUTF8 PositionEncodingKind = "utf-8"
// PositionEncodingKindUTF16 Character offsets count UTF-16 code units.
//
// This is the default and must always be supported
// by servers
PositionEncodingKindUTF16 PositionEncodingKind = "utf-16"
// PositionEncodingKindUTF32 Character offsets count UTF-32 code units.
//
// Implementation note: these are the same as Unicode codepoints,
// so this `PositionEncodingKind` may also be used for an
// encoding-agnostic representation of character offsets.
PositionEncodingKindUTF32 PositionEncodingKind = "utf-32"
)
// FileChangeType The file event type
type FileChangeType uint32
// FileChangeType enumeration values.
const (
// FileChangeTypeCreated The file got created.
FileChangeTypeCreated FileChangeType = 1
// FileChangeTypeChanged The file got changed.
FileChangeTypeChanged FileChangeType = 2
// FileChangeTypeDeleted The file got deleted.
FileChangeTypeDeleted FileChangeType = 3
)
// WatchKind is defined by the LSP specification.
type WatchKind uint32
// WatchKind enumeration values.
const (
// WatchKindCreate Interested in create events.
WatchKindCreate WatchKind = 1
// WatchKindChange Interested in change events
WatchKindChange WatchKind = 2
// WatchKindDelete Interested in delete events
WatchKindDelete WatchKind = 4
)
// DiagnosticSeverity The diagnostic's severity.
type DiagnosticSeverity uint32
// DiagnosticSeverity enumeration values.
const (
// DiagnosticSeverityError Reports an error.
DiagnosticSeverityError DiagnosticSeverity = 1
// DiagnosticSeverityWarning Reports a warning.
DiagnosticSeverityWarning DiagnosticSeverity = 2
// DiagnosticSeverityInformation Reports an information.
DiagnosticSeverityInformation DiagnosticSeverity = 3
// DiagnosticSeverityHint Reports a hint.
DiagnosticSeverityHint DiagnosticSeverity = 4
)
// DiagnosticTag The diagnostic tags.
//
// Since: 3.15.0
type DiagnosticTag uint32
// DiagnosticTag enumeration values.
const (
// DiagnosticTagUnnecessary Unused or unnecessary code.
//
// Clients are allowed to render diagnostics with this tag faded out instead of having
// an error squiggle.
DiagnosticTagUnnecessary DiagnosticTag = 1
// DiagnosticTagDeprecated Deprecated or obsolete code.
//
// Clients are allowed to rendered diagnostics with this tag strike through.
DiagnosticTagDeprecated DiagnosticTag = 2
)
// ApplyKind Defines how values from a set of defaults and an individual item will be
// merged.
//
// Since: 3.18.0
type ApplyKind uint32
// ApplyKind enumeration values.
const (
// ApplyKindReplace The value from the individual item (if provided and not `null`) will be
// used instead of the default.
ApplyKindReplace ApplyKind = 1
// ApplyKindMerge The value from the item will be merged with the default.
//
// The specific rules for mergeing values are defined against each field
// that supports merging.
ApplyKindMerge ApplyKind = 2
)
// ResourceOperationKind is defined by the LSP specification.
type ResourceOperationKind string
// ResourceOperationKind enumeration values.
const (
// ResourceOperationKindCreate Supports creating new files and folders.
ResourceOperationKindCreate ResourceOperationKind = "create"
// ResourceOperationKindRename Supports renaming existing files and folders.
ResourceOperationKindRename ResourceOperationKind = "rename"
// ResourceOperationKindDelete Supports deleting existing files and folders.
ResourceOperationKindDelete ResourceOperationKind = "delete"
)
// FailureHandlingKind is defined by the LSP specification.
type FailureHandlingKind string
// FailureHandlingKind enumeration values.
const (
// FailureHandlingKindAbort Applying the workspace change is simply aborted if one of the changes provided
// fails. All operations executed before the failing operation stay executed.
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.
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.
FailureHandlingKindTextOnlyTransactional FailureHandlingKind = "textOnlyTransactional"
// FailureHandlingKindUndo The client tries to undo the operations already executed. But there is no
// guarantee that this is succeeding.
FailureHandlingKindUndo FailureHandlingKind = "undo"
)
// TokenFormat is defined by the LSP specification.
type TokenFormat string
// TokenFormat enumeration values.
const (
// TokenFormatRelative is defined by the LSP specification.
TokenFormatRelative TokenFormat = "relative"
)
// DocumentSelector A document selector is the combination of one or many document filters.
//
// @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`;
//
// The use of a string as a document filter is deprecated.
//
// Since: 3.16.0.
type DocumentSelector []DocumentFilter
// ChangeAnnotationIdentifier An identifier to refer to a change annotation stored with a workspace edit.
type ChangeAnnotationIdentifier string
// Pattern The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:
// - `*` to match zero or more characters in a path segment
// - `?` to match on one character in a path segment
// - `**` to match any number of path segments, including none
// - `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
// - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
// - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
//
// Since: 3.17.0
type Pattern string
// RegularExpressionEngineKind is defined by the LSP specification.
type RegularExpressionEngineKind string
// Location Represents a location inside a resource, such as a line
// inside a text file.
type Location struct {
// URI is defined by the LSP specification.
URI uri.URI `json:"uri"`
// Range is defined by the LSP specification.
Range Range `json:"range"`
}
// WorkDoneProgressOptions is defined by the LSP specification.
type WorkDoneProgressOptions struct {
// WorkDoneProgress is defined by the LSP specification.
WorkDoneProgress *bool `json:"workDoneProgress,omitzero"`
}
// TextDocumentRegistrationOptions General text document registration options.
type TextDocumentRegistrationOptions struct {
// DocumentSelector 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 `json:"documentSelector"`
}
// WorkspaceEdit A workspace edit represents changes to many resources managed in the workspace. The edit
// should either provide `changes` or `documentChanges`. If documentChanges are present
// they are preferred over `changes` if the client can handle versioned document edits.
//
// Since version 3.13.0 a workspace edit can contain resource operations as well. If resource
// operations are present clients need to execute the operations in the order in which they
// are provided. So a workspace edit for example can consist of the following two changes:
// (1) a create file a.txt and (2) a text document edit which insert text into file a.txt.
//
// An invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will
// cause failure of the operation. How the client recovers from the failure is described by
// the client capability: `workspace.workspaceEdit.failureHandling`
type WorkspaceEdit struct {
// Changes Holds changes to existing resources.
Changes map[uri.URI][]TextEdit `json:"changes,omitzero"`
// DocumentChanges Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes
// are either an array of `TextDocumentEdit`s to express changes to n different text documents
// where each text document edit addresses a specific version of a text document. Or it can contain
// above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.
//
// Whether a client supports versioned document edits is expressed via
// `workspace.workspaceEdit.documentChanges` client capability.
//
// If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then
// only plain `TextEdit`s using the `changes` property are supported.
DocumentChanges []DocumentChange `json:"documentChanges,omitzero"`
// ChangeAnnotations A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and
// delete file / folder operations.
//
// Whether clients honor this property depends on the client capability `workspace.changeAnnotationSupport`.
//
// Since: 3.16.0
ChangeAnnotations map[ChangeAnnotationIdentifier]ChangeAnnotation `json:"changeAnnotations,omitzero"`
}
// TextEdit A text edit applicable to a text document.
type TextEdit struct {
// Range The range of the text document to be manipulated. To insert
// text into a document create a range where start === end.
Range Range `json:"range"`
// NewText The string to be inserted. For delete operations use an
// empty string.
NewText string `json:"newText"`
}
// SymbolInformation Represents information about programming constructs like variables, classes,
// interfaces etc.
type SymbolInformation struct {
BaseSymbolInformation
// Deprecated Indicates if this symbol is deprecated.
//
// Deprecated: Use tags instead
Deprecated *bool `json:"deprecated,omitzero"`
// Location The location of this symbol. The location's range is used by a tool
// to reveal the location in the editor. If the symbol is selected in the
// tool the range's start information is used to position the cursor. So
// the range usually spans more than the actual symbol's name and does
// normally include things like visibility modifiers.
//
// The range doesn't have to denote a node range in the sense of an abstract
// syntax tree. It can therefore not be used to re-construct a hierarchy of
// the symbols.
Location Location `json:"location"`
}
// Command 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 Title of the command, like `save`.
Title string `json:"title"`
// Tooltip An optional tooltip.
//
// Since: 3.18.0
Tooltip *string `json:"tooltip,omitzero"`
// Command The identifier of the actual command handler.
Command string `json:"command"`
// Arguments Arguments that the command handler should be
// invoked with.
Arguments []LSPAny `json:"arguments,omitzero"`
}
// WorkDoneProgressBegin is defined by the LSP specification.
type WorkDoneProgressBegin struct {
// Kind is defined by the LSP specification.
Kind string `json:"kind"`
// Title Mandatory title of the progress operation. Used to briefly inform about
// the kind of operation being performed.
//
// Examples: "Indexing" or "Linking dependencies".
Title string `json:"title"`
// Cancellable Controls if a cancel button should show to allow the user to cancel the
// long running operation. Clients that don't support cancellation are allowed
// to ignore the setting.
Cancellable *bool `json:"cancellable,omitzero"`
// Message Optional, more detailed associated progress message. Contains
// complementary information to the `title`.
//
// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
// If unset, the previous progress message (if any) is still valid.
Message *string `json:"message,omitzero"`
// Percentage Optional progress percentage to display (value 100 is considered 100%).
// If not provided infinite progress is assumed and clients are allowed
// to ignore the `percentage` value in subsequent in report notifications.
//
// The value should be steadily rising. Clients are free to ignore values
// that are not following this rule. The value range is [0, 100].
Percentage *uint32 `json:"percentage,omitzero"`
}
// WorkDoneProgressReport is defined by the LSP specification.
type WorkDoneProgressReport struct {
// Kind is defined by the LSP specification.
Kind string `json:"kind"`
// Cancellable Controls enablement state of a cancel button.
//
// Clients that don't support cancellation or don't support controlling the button's
// enablement state are allowed to ignore the property.
Cancellable *bool `json:"cancellable,omitzero"`
// Message Optional, more detailed associated progress message. Contains
// complementary information to the `title`.
//
// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
// If unset, the previous progress message (if any) is still valid.
Message *string `json:"message,omitzero"`
// Percentage Optional progress percentage to display (value 100 is considered 100%).
// If not provided infinite progress is assumed and clients are allowed
// to ignore the `percentage` value in subsequent in report notifications.
//
// The value should be steadily rising. Clients are free to ignore values
// that are not following this rule. The value range is [0, 100]
Percentage *uint32 `json:"percentage,omitzero"`
}
// WorkDoneProgressEnd is defined by the LSP specification.
type WorkDoneProgressEnd struct {
// Kind is defined by the LSP specification.
Kind string `json:"kind"`
// Message Optional, a final message indicating to for example indicate the outcome
// of the operation.
Message *string `json:"message,omitzero"`
}
// CancelParams is defined by the LSP specification.
type CancelParams struct {
// ID The request id to cancel.
ID ProgressToken `json:"id"`
}
// TextDocumentPositionParams A parameter literal used in requests to pass a text document and a position inside that
// document.
type TextDocumentPositionParams struct {
// TextDocument The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// Position The position inside the text document.
Position Position `json:"position"`
}
// WorkDoneProgressParams is defined by the LSP specification.
type WorkDoneProgressParams struct {
// WorkDoneToken An optional token that a server can use to report work done progress.
WorkDoneToken ProgressToken `json:"workDoneToken,omitzero"`
}
// PartialResultParams is defined by the LSP specification.
type PartialResultParams struct {
// PartialResultToken An optional token that a server can use to report partial results (e.g. streaming) to
// the client.
PartialResultToken ProgressToken `json:"partialResultToken,omitzero"`
}
// LocationLink Represents the connection of two locations. Provides additional metadata over normal [Location],
// including an origin range.
type LocationLink struct {
// OriginSelectionRange Span of the origin of this link.
//
// Used as the underlined span for mouse interaction. Defaults to the word range at
// the definition position.
OriginSelectionRange *Range `json:"originSelectionRange,omitzero"`
// TargetURI The target resource identifier of this link.
TargetURI uri.URI `json:"targetUri"`
// TargetRange The full target range of this link. If the target for example is a symbol then target range is the
// range enclosing this symbol not including leading/trailing whitespace but everything else
// like comments. This information is typically used to highlight the range in the editor.
TargetRange Range `json:"targetRange"`
// TargetSelectionRange The range that should be selected and revealed when this link is being followed, e.g the name of a function.
// Must be contained by the `targetRange`. See also `DocumentSymbol#range`
TargetSelectionRange Range `json:"targetSelectionRange"`
}
// Range A range in a text document expressed as (zero-based) start and end positions.
//
// If you want to specify a range that contains a line including the line ending
// character(s) then use an end position denoting the start of the next line.
// For example:
// ```ts
//
// {
// start: { line: 5, character: 23 }
// end : { line 6, character : 0 }
// }
//
// ```
type Range struct {
// Start The range's start position.
Start Position `json:"start"`
// End The range's end position.
End Position `json:"end"`
}
// StaticRegistrationOptions Static registration options to be returned in the initialize
// request.
type StaticRegistrationOptions struct {
// ID The id used to register the request. The id can be used to deregister
// the request again. See also Registration#id.
ID *string `json:"id,omitzero"`
}
// TextDocumentIdentifier A literal to identify a text document in the client.
type TextDocumentIdentifier struct {
// URI The text document's uri.
URI uri.URI `json:"uri"`
}
// Position Position in a text document expressed as zero-based line and character
// offset. Prior to 3.17 the offsets were always based on a UTF-16 string
// representation. So a string of the form `a𐐀b` the character offset of the
// character `a` is 0, the character offset of `𐐀` is 1 and the character
// offset of b is 3 since `𐐀` is represented using two code units in UTF-16.
// Since 3.17 clients and servers can agree on a different string encoding
// representation (e.g. UTF-8). The client announces it's supported encoding
// via the client capability [`general.positionEncodings`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#clientCapabilities).
// The value is an array of position encodings the client supports, with
// decreasing preference (e.g. the encoding at index `0` is the most preferred
// one). To stay backwards compatible the only mandatory encoding is UTF-16
// represented via the string `utf-16`. The server can pick one of the
// encodings offered by the client and signals that encoding back to the
// client via the initialize result's property
// [`capabilities.positionEncoding`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#serverCapabilities). If the string value
// `utf-16` is missing from the client's capability `general.positionEncodings`
// servers can safely assume that the client supports UTF-16. If the server
// omits the position encoding in its initialize result the encoding defaults
// to the string value `utf-16`. Implementation considerations: since the
// conversion from one encoding into another requires the content of the
// file / line the conversion is best done where the file is read which is
// usually on the server side.
//
// Positions are line end character agnostic. So you can not specify a position
// that denotes `\r|\n` or `\n|` where `|` represents the character offset.
//
// support for negotiated position encoding.
//
// Since: 3.17.0 - support for negotiated position encoding.
type Position struct {
// Line Line position in a document (zero-based).
Line uint32 `json:"line"`
// Character Character offset on a line in a document (zero-based).
//
// The meaning of this offset is determined by the negotiated
// `PositionEncodingKind`.
Character uint32 `json:"character"`
}
// TextDocumentEdit Describes textual changes on a text document. A TextDocumentEdit describes all changes
// on a document version Si and after they are applied move the document to version Si+1.
// So the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any
// kind of ordering. However the edits must be non overlapping.
type TextDocumentEdit struct {
// TextDocument The text document to change.
TextDocument OptionalVersionedTextDocumentIdentifier `json:"textDocument"`
// Edits The edits to be applied.
//
// support for AnnotatedTextEdit. This is guarded using a
// client capability.
//
// support for SnippetTextEdit. This is guarded using a
// client capability.
//
// Since: 3.18.0 - support for SnippetTextEdit. This is guarded using a
// client capability.
Edits []TextDocumentEditElement `json:"edits"`
}
// CreateFile Create file operation.
type CreateFile struct {
ResourceOperation
// Kind A create
Kind string `json:"kind"`
// URI The resource to create.
URI uri.URI `json:"uri"`
// Options Additional options
Options *CreateFileOptions `json:"options,omitzero"`
}
// DeleteFile Delete file operation
type DeleteFile struct {
ResourceOperation
// Kind A delete
Kind string `json:"kind"`
// URI The file to delete.
URI uri.URI `json:"uri"`
// Options Delete options.
Options *DeleteFileOptions `json:"options,omitzero"`
}
// ChangeAnnotation Additional information that describes document changes.
//
// Since: 3.16.0
type ChangeAnnotation struct {
// Label A human-readable string describing the actual change. The string
// is rendered prominent in the user interface.
Label string `json:"label"`
// NeedsConfirmation A flag which indicates that user confirmation is needed
// before applying the change.
NeedsConfirmation *bool `json:"needsConfirmation,omitzero"`
// Description A human-readable string which is rendered less prominent in
// the user interface.
Description *string `json:"description,omitzero"`
}
// MarkupContent A `MarkupContent` literal represents a string value which content is interpreted base on its
// kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.
//
// If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.
// See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
//
// Here is an example how such a string can be constructed using JavaScript / TypeScript:
// ```ts
//
// let markdown: MarkdownContent = {
// kind: MarkupKind.Markdown,
// value: [
// '# Header',
// 'Some text',
// '```typescript',
// 'someCode();',
// '```'
// ].join('\n')
// };
//
// ```
//
// *Please Note* that clients might sanitize the return markdown. A client could decide to
// remove HTML from the markdown to avoid script execution.
type MarkupContent struct {
// Kind The type of the Markup
Kind MarkupKind `json:"kind"`
// Value The content itself
Value string `json:"value"`
}
// TextDocumentItem An item to transfer a text document from the client to the
// server.
type TextDocumentItem struct {
// URI The text document's uri.
URI uri.URI `json:"uri"`
// LanguageID The text document's language identifier.
LanguageID LanguageKind `json:"languageId"`
// Version The version number of this document (it will increase after each
// change, including undo/redo).
Version int32 `json:"version"`
// Text The content of the opened text document.
Text string `json:"text"`
}
// StringValue A string value used as a snippet is a template which allows to insert text
// and to control the editor cursor when insertion happens.
//
// 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. Variables are defined with `$name` and
// `${name:default value}`.
//
// Since: 3.18.0
type StringValue struct {
// Kind The kind of string value.
Kind string `json:"kind"`
// Value The snippet string.
Value string `json:"value"`
}
// VersionedTextDocumentIdentifier A text document identifier to denote a specific version of a text document.
type VersionedTextDocumentIdentifier struct {
TextDocumentIdentifier
// Version The version number of this document.
Version int32 `json:"version"`
}
// Diagnostic Represents a diagnostic, such as a compiler error or warning. Diagnostic objects
// are only valid in the scope of a resource.
type Diagnostic struct {
// Range The range at which the message applies
Range Range `json:"range"`
// Severity The diagnostic's severity. To avoid interpretation mismatches when a
// server is used with different clients it is highly recommended that servers
// always provide a severity value.
Severity DiagnosticSeverity `json:"severity,omitzero"`
// Code The diagnostic's code, which usually appear in the user interface.
Code ProgressToken `json:"code,omitzero"`
// CodeDescription An optional property to describe the error code.
// Requires the code field (above) to be present/not null.
//
// Since: 3.16.0
CodeDescription CodeDescription `json:"codeDescription,omitzero"`
// Source A human-readable string describing the source of this
// diagnostic, e.g. 'typescript' or 'super lint'. It usually
// appears in the user interface.
Source Optional[string] `json:"source,omitzero"`
// Message The diagnostic's message. It usually appears in the user interface.
//
// support for MarkupContent. This is guarded by the client
// capability `textDocument.diagnostic.markupMessageSupport`.
//
// Since: 3.18.0 - support for MarkupContent. This is guarded by the client
// capability `textDocument.diagnostic.markupMessageSupport`.
Message InlayHintTooltip `json:"message"`
// Tags Additional metadata about the diagnostic.
//
// Since: 3.15.0
Tags DiagnosticTags `json:"tags,omitzero"`
// RelatedInformation An array of related diagnostic information, e.g. when symbol-names within
// a scope collide all definitions can be marked via this property.
RelatedInformation []DiagnosticRelatedInformation `json:"relatedInformation,omitzero"`
// Data A data entry field that is preserved between a `textDocument/publishDiagnostics`
// notification and `textDocument/codeAction` request.
//
// Since: 3.16.0
Data LSPAny `json:"data,omitzero"`
}
// InsertReplaceEdit A special text edit to provide an insert and a replace operation.
//
// Since: 3.16.0
type InsertReplaceEdit struct {
// NewText The string to be inserted.
NewText string `json:"newText"`
// Insert The range if the insert is requested
Insert Range `json:"insert"`
// Replace The range if the replace is requested.
Replace Range `json:"replace"`
}
// BaseSymbolInformation A base for all symbol information.
type BaseSymbolInformation struct {
// Name The name of this symbol.
Name string `json:"name"`
// Kind The kind of this symbol.
Kind SymbolKind `json:"kind"`
// Tags Tags for this symbol.
//
// Since: 3.16.0
Tags []SymbolTag `json:"tags,omitzero"`
// ContainerName The name of the symbol containing this symbol. This information is for
// user interface purposes (e.g. to render a qualifier in the user interface
// if necessary). It can't be used to re-infer a hierarchy for the document
// symbols.
ContainerName *string `json:"containerName,omitzero"`