puppet-editor-services 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +510 -0
  3. data/CODEOWNERS +2 -0
  4. data/CODE_OF_CONDUCT.md +46 -0
  5. data/CONTRIBUTING.md +54 -0
  6. data/Gemfile +53 -0
  7. data/LICENSE +201 -0
  8. data/README.md +308 -0
  9. data/Rakefile +185 -0
  10. data/bin/puppet-debugserver +8 -0
  11. data/bin/puppet-languageserver +7 -0
  12. data/bin/puppet-languageserver-sidecar +7 -0
  13. data/lib/dsp/dsp.rb +7 -0
  14. data/lib/dsp/dsp_base.rb +62 -0
  15. data/lib/dsp/dsp_protocol.rb +4619 -0
  16. data/lib/lsp/lsp.rb +10 -0
  17. data/lib/lsp/lsp_base.rb +63 -0
  18. data/lib/lsp/lsp_custom.rb +170 -0
  19. data/lib/lsp/lsp_enums.rb +143 -0
  20. data/lib/lsp/lsp_protocol.rb +2785 -0
  21. data/lib/lsp/lsp_protocol_callhierarchy.proposed.rb +239 -0
  22. data/lib/lsp/lsp_protocol_colorprovider.rb +100 -0
  23. data/lib/lsp/lsp_protocol_configuration.rb +82 -0
  24. data/lib/lsp/lsp_protocol_declaration.rb +73 -0
  25. data/lib/lsp/lsp_protocol_foldingrange.rb +129 -0
  26. data/lib/lsp/lsp_protocol_implementation.rb +75 -0
  27. data/lib/lsp/lsp_protocol_progress.rb +200 -0
  28. data/lib/lsp/lsp_protocol_selectionrange.rb +79 -0
  29. data/lib/lsp/lsp_protocol_sematictokens.proposed.rb +340 -0
  30. data/lib/lsp/lsp_protocol_typedefinition.rb +75 -0
  31. data/lib/lsp/lsp_protocol_workspacefolders.rb +174 -0
  32. data/lib/lsp/lsp_types.rb +1534 -0
  33. data/lib/puppet-debugserver/debug_session/break_points.rb +137 -0
  34. data/lib/puppet-debugserver/debug_session/flow_control.rb +161 -0
  35. data/lib/puppet-debugserver/debug_session/hook_handlers.rb +295 -0
  36. data/lib/puppet-debugserver/debug_session/puppet_session_run_mode.rb +66 -0
  37. data/lib/puppet-debugserver/debug_session/puppet_session_state.rb +122 -0
  38. data/lib/puppet-debugserver/hooks.rb +132 -0
  39. data/lib/puppet-debugserver/message_handler.rb +277 -0
  40. data/lib/puppet-debugserver/puppet_debug_session.rb +541 -0
  41. data/lib/puppet-debugserver/puppet_monkey_patches.rb +118 -0
  42. data/lib/puppet-languageserver/client_session_state.rb +119 -0
  43. data/lib/puppet-languageserver/crash_dump.rb +50 -0
  44. data/lib/puppet-languageserver/epp/validation_provider.rb +34 -0
  45. data/lib/puppet-languageserver/facter_helper.rb +25 -0
  46. data/lib/puppet-languageserver/global_queues/sidecar_queue.rb +205 -0
  47. data/lib/puppet-languageserver/global_queues/single_instance_queue.rb +126 -0
  48. data/lib/puppet-languageserver/global_queues/validation_queue.rb +102 -0
  49. data/lib/puppet-languageserver/global_queues.rb +16 -0
  50. data/lib/puppet-languageserver/manifest/completion_provider.rb +331 -0
  51. data/lib/puppet-languageserver/manifest/definition_provider.rb +99 -0
  52. data/lib/puppet-languageserver/manifest/document_symbol_provider.rb +228 -0
  53. data/lib/puppet-languageserver/manifest/folding_provider.rb +226 -0
  54. data/lib/puppet-languageserver/manifest/format_on_type_provider.rb +143 -0
  55. data/lib/puppet-languageserver/manifest/hover_provider.rb +221 -0
  56. data/lib/puppet-languageserver/manifest/signature_provider.rb +169 -0
  57. data/lib/puppet-languageserver/manifest/validation_provider.rb +127 -0
  58. data/lib/puppet-languageserver/message_handler.rb +462 -0
  59. data/lib/puppet-languageserver/providers.rb +18 -0
  60. data/lib/puppet-languageserver/puppet_helper.rb +108 -0
  61. data/lib/puppet-languageserver/puppet_lexer_helper.rb +55 -0
  62. data/lib/puppet-languageserver/puppet_monkey_patches.rb +39 -0
  63. data/lib/puppet-languageserver/puppet_parser_helper.rb +212 -0
  64. data/lib/puppet-languageserver/puppetfile/validation_provider.rb +185 -0
  65. data/lib/puppet-languageserver/server_capabilities.rb +48 -0
  66. data/lib/puppet-languageserver/session_state/document_store.rb +272 -0
  67. data/lib/puppet-languageserver/session_state/language_client.rb +239 -0
  68. data/lib/puppet-languageserver/session_state/object_cache.rb +162 -0
  69. data/lib/puppet-languageserver/sidecar_protocol.rb +532 -0
  70. data/lib/puppet-languageserver/uri_helper.rb +46 -0
  71. data/lib/puppet-languageserver-sidecar/cache/base.rb +36 -0
  72. data/lib/puppet-languageserver-sidecar/cache/filesystem.rb +111 -0
  73. data/lib/puppet-languageserver-sidecar/cache/null.rb +27 -0
  74. data/lib/puppet-languageserver-sidecar/facter_helper.rb +41 -0
  75. data/lib/puppet-languageserver-sidecar/puppet_environment_monkey_patches.rb +52 -0
  76. data/lib/puppet-languageserver-sidecar/puppet_helper.rb +281 -0
  77. data/lib/puppet-languageserver-sidecar/puppet_modulepath_monkey_patches.rb +146 -0
  78. data/lib/puppet-languageserver-sidecar/puppet_monkey_patches.rb +9 -0
  79. data/lib/puppet-languageserver-sidecar/puppet_parser_helper.rb +77 -0
  80. data/lib/puppet-languageserver-sidecar/puppet_strings_helper.rb +399 -0
  81. data/lib/puppet-languageserver-sidecar/puppet_strings_monkey_patches.rb +16 -0
  82. data/lib/puppet-languageserver-sidecar/sidecar_protocol_extensions.rb +16 -0
  83. data/lib/puppet-languageserver-sidecar/workspace.rb +89 -0
  84. data/lib/puppet_debugserver.rb +164 -0
  85. data/lib/puppet_editor_services/connection/base.rb +62 -0
  86. data/lib/puppet_editor_services/connection/stdio.rb +25 -0
  87. data/lib/puppet_editor_services/connection/tcp.rb +34 -0
  88. data/lib/puppet_editor_services/handler/base.rb +16 -0
  89. data/lib/puppet_editor_services/handler/debug_adapter.rb +63 -0
  90. data/lib/puppet_editor_services/handler/json_rpc.rb +133 -0
  91. data/lib/puppet_editor_services/logging.rb +45 -0
  92. data/lib/puppet_editor_services/protocol/base.rb +27 -0
  93. data/lib/puppet_editor_services/protocol/debug_adapter.rb +135 -0
  94. data/lib/puppet_editor_services/protocol/debug_adapter_messages.rb +171 -0
  95. data/lib/puppet_editor_services/protocol/json_rpc.rb +241 -0
  96. data/lib/puppet_editor_services/protocol/json_rpc_messages.rb +200 -0
  97. data/lib/puppet_editor_services/server/base.rb +42 -0
  98. data/lib/puppet_editor_services/server/stdio.rb +85 -0
  99. data/lib/puppet_editor_services/server/tcp.rb +349 -0
  100. data/lib/puppet_editor_services/server.rb +15 -0
  101. data/lib/puppet_editor_services/version.rb +36 -0
  102. data/lib/puppet_editor_services.rb +8 -0
  103. data/lib/puppet_languageserver.rb +263 -0
  104. data/lib/puppet_languageserver_sidecar.rb +361 -0
  105. data/puppet-debugserver +11 -0
  106. data/puppet-editor-services.gemspec +29 -0
  107. data/puppet-languageserver +15 -0
  108. data/puppet-languageserver-sidecar +14 -0
  109. metadata +240 -0
@@ -0,0 +1,1534 @@
1
+ # frozen_string_literal: true
2
+
3
+ # DO NOT MODIFY. This file is built automatically
4
+ # LSP Protocol: vscode-languageserver-types/lib/esm/main.d.ts
5
+
6
+ # rubocop:disable Layout/EmptyLinesAroundClassBody
7
+ # rubocop:disable Lint/UselessAssignment
8
+ # rubocop:disable Naming/MethodName
9
+
10
+ module LSP
11
+ # export interface Position {
12
+ # /**
13
+ # * Line position in a document (zero-based).
14
+ # * If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document.
15
+ # * If a line number is negative, it defaults to 0.
16
+ # */
17
+ # line: number;
18
+ # /**
19
+ # * Character offset on a line in a document (zero-based). Assuming that the line is
20
+ # * represented as a string, the `character` value represents the gap between the
21
+ # * `character` and `character + 1`.
22
+ # *
23
+ # * If the character value is greater than the line length it defaults back to the
24
+ # * line length.
25
+ # * If a line number is negative, it defaults to 0.
26
+ # */
27
+ # character: number;
28
+ # }
29
+ class Position < LSPBase
30
+ attr_accessor :line, :character # type: number # type: number
31
+
32
+ def from_h!(value)
33
+ value = {} if value.nil?
34
+ self.line = value['line']
35
+ self.character = value['character']
36
+ self
37
+ end
38
+ end
39
+
40
+ # export interface Range {
41
+ # /**
42
+ # * The range's start position
43
+ # */
44
+ # start: Position;
45
+ # /**
46
+ # * The range's end position.
47
+ # */
48
+ # end: Position;
49
+ # }
50
+ class Range < LSPBase
51
+ attr_accessor :start, :end # type: Position # type: Position
52
+
53
+ def from_h!(value)
54
+ value = {} if value.nil?
55
+ self.start = Position.new(value['start']) unless value['start'].nil?
56
+ self.end = Position.new(value['end']) unless value['end'].nil?
57
+ self
58
+ end
59
+ end
60
+
61
+ # export interface Location {
62
+ # uri: DocumentUri;
63
+ # range: Range;
64
+ # }
65
+ class Location < LSPBase
66
+ attr_accessor :uri, :range # type: DocumentUri # type: Range
67
+
68
+ def from_h!(value)
69
+ value = {} if value.nil?
70
+ self.uri = value['uri'] # Unknown type
71
+ self.range = Range.new(value['range']) unless value['range'].nil?
72
+ self
73
+ end
74
+ end
75
+
76
+ # export interface LocationLink {
77
+ # /**
78
+ # * Span of the origin of this link.
79
+ # *
80
+ # * Used as the underlined span for mouse definition hover. Defaults to the word range at
81
+ # * the definition position.
82
+ # */
83
+ # originSelectionRange?: Range;
84
+ # /**
85
+ # * The target resource identifier of this link.
86
+ # */
87
+ # targetUri: DocumentUri;
88
+ # /**
89
+ # * The full target range of this link. If the target for example is a symbol then target range is the
90
+ # * range enclosing this symbol not including leading/trailing whitespace but everything else
91
+ # * like comments. This information is typically used to highlight the range in the editor.
92
+ # */
93
+ # targetRange: Range;
94
+ # /**
95
+ # * The range that should be selected and revealed when this link is being followed, e.g the name of a function.
96
+ # * Must be contained by the the `targetRange`. See also `DocumentSymbol#range`
97
+ # */
98
+ # targetSelectionRange: Range;
99
+ # }
100
+ class LocationLink < LSPBase
101
+ attr_accessor :originSelectionRange, :targetUri, :targetRange, :targetSelectionRange # type: Range # type: DocumentUri # type: Range # type: Range
102
+
103
+ def initialize(initial_hash = nil)
104
+ super
105
+ @optional_method_names = %i[originSelectionRange]
106
+ end
107
+
108
+ def from_h!(value)
109
+ value = {} if value.nil?
110
+ self.originSelectionRange = Range.new(value['originSelectionRange']) unless value['originSelectionRange'].nil?
111
+ self.targetUri = value['targetUri'] # Unknown type
112
+ self.targetRange = Range.new(value['targetRange']) unless value['targetRange'].nil?
113
+ self.targetSelectionRange = Range.new(value['targetSelectionRange']) unless value['targetSelectionRange'].nil?
114
+ self
115
+ end
116
+ end
117
+
118
+ # export interface Color {
119
+ # /**
120
+ # * The red component of this color in the range [0-1].
121
+ # */
122
+ # readonly red: number;
123
+ # /**
124
+ # * The green component of this color in the range [0-1].
125
+ # */
126
+ # readonly green: number;
127
+ # /**
128
+ # * The blue component of this color in the range [0-1].
129
+ # */
130
+ # readonly blue: number;
131
+ # /**
132
+ # * The alpha component of this color in the range [0-1].
133
+ # */
134
+ # readonly alpha: number;
135
+ # }
136
+ class Color < LSPBase
137
+ attr_accessor :red, :green, :blue, :alpha # type: number # type: number # type: number # type: number
138
+
139
+ def from_h!(value)
140
+ value = {} if value.nil?
141
+ self.red = value['red']
142
+ self.green = value['green']
143
+ self.blue = value['blue']
144
+ self.alpha = value['alpha']
145
+ self
146
+ end
147
+ end
148
+
149
+ # export interface ColorInformation {
150
+ # /**
151
+ # * The range in the document where this color appers.
152
+ # */
153
+ # range: Range;
154
+ # /**
155
+ # * The actual color value for this color range.
156
+ # */
157
+ # color: Color;
158
+ # }
159
+ class ColorInformation < LSPBase
160
+ attr_accessor :range, :color # type: Range # type: Color
161
+
162
+ def from_h!(value)
163
+ value = {} if value.nil?
164
+ self.range = Range.new(value['range']) unless value['range'].nil?
165
+ self.color = Color.new(value['color']) unless value['color'].nil?
166
+ self
167
+ end
168
+ end
169
+
170
+ # export interface ColorPresentation {
171
+ # /**
172
+ # * The label of this color presentation. It will be shown on the color
173
+ # * picker header. By default this is also the text that is inserted when selecting
174
+ # * this color presentation.
175
+ # */
176
+ # label: string;
177
+ # /**
178
+ # * An [edit](#TextEdit) which is applied to a document when selecting
179
+ # * this presentation for the color. When `falsy` the [label](#ColorPresentation.label)
180
+ # * is used.
181
+ # */
182
+ # textEdit?: TextEdit;
183
+ # /**
184
+ # * An optional array of additional [text edits](#TextEdit) that are applied when
185
+ # * selecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves.
186
+ # */
187
+ # additionalTextEdits?: TextEdit[];
188
+ # }
189
+ class ColorPresentation < LSPBase
190
+ attr_accessor :label, :textEdit, :additionalTextEdits # type: string # type: TextEdit # type: TextEdit[]
191
+
192
+ def initialize(initial_hash = nil)
193
+ super
194
+ @optional_method_names = %i[textEdit additionalTextEdits]
195
+ end
196
+
197
+ def from_h!(value)
198
+ value = {} if value.nil?
199
+ self.label = value['label']
200
+ self.textEdit = TextEdit.new(value['textEdit']) unless value['textEdit'].nil?
201
+ self.additionalTextEdits = to_typed_aray(value['additionalTextEdits'], TextEdit)
202
+ self
203
+ end
204
+ end
205
+
206
+ # export interface FoldingRange {
207
+ # /**
208
+ # * The zero-based line number from where the folded range starts.
209
+ # */
210
+ # startLine: number;
211
+ # /**
212
+ # * The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.
213
+ # */
214
+ # startCharacter?: number;
215
+ # /**
216
+ # * The zero-based line number where the folded range ends.
217
+ # */
218
+ # endLine: number;
219
+ # /**
220
+ # * The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
221
+ # */
222
+ # endCharacter?: number;
223
+ # /**
224
+ # * Describes the kind of the folding range such as `comment' or 'region'. The kind
225
+ # * is used to categorize folding ranges and used by commands like 'Fold all comments'. See
226
+ # * [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.
227
+ # */
228
+ # kind?: string;
229
+ # }
230
+ class FoldingRange < LSPBase
231
+ attr_accessor :startLine, :startCharacter, :endLine, :endCharacter, :kind # type: number # type: number # type: number # type: number # type: string
232
+
233
+ def initialize(initial_hash = nil)
234
+ super
235
+ @optional_method_names = %i[startCharacter endCharacter kind]
236
+ end
237
+
238
+ def from_h!(value)
239
+ value = {} if value.nil?
240
+ self.startLine = value['startLine']
241
+ self.startCharacter = value['startCharacter']
242
+ self.endLine = value['endLine']
243
+ self.endCharacter = value['endCharacter']
244
+ self.kind = value['kind']
245
+ self
246
+ end
247
+ end
248
+
249
+ # export interface DiagnosticRelatedInformation {
250
+ # /**
251
+ # * The location of this related diagnostic information.
252
+ # */
253
+ # location: Location;
254
+ # /**
255
+ # * The message of this related diagnostic information.
256
+ # */
257
+ # message: string;
258
+ # }
259
+ class DiagnosticRelatedInformation < LSPBase
260
+ attr_accessor :location, :message # type: Location # type: string
261
+
262
+ def from_h!(value)
263
+ value = {} if value.nil?
264
+ self.location = Location.new(value['location']) unless value['location'].nil?
265
+ self.message = value['message']
266
+ self
267
+ end
268
+ end
269
+
270
+ # export interface Diagnostic {
271
+ # /**
272
+ # * The range at which the message applies
273
+ # */
274
+ # range: Range;
275
+ # /**
276
+ # * The diagnostic's severity. Can be omitted. If omitted it is up to the
277
+ # * client to interpret diagnostics as error, warning, info or hint.
278
+ # */
279
+ # severity?: DiagnosticSeverity;
280
+ # /**
281
+ # * The diagnostic's code, which usually appear in the user interface.
282
+ # */
283
+ # code?: number | string;
284
+ # /**
285
+ # * A human-readable string describing the source of this
286
+ # * diagnostic, e.g. 'typescript' or 'super lint'. It usually
287
+ # * appears in the user interface.
288
+ # */
289
+ # source?: string;
290
+ # /**
291
+ # * The diagnostic's message. It usually appears in the user interface
292
+ # */
293
+ # message: string;
294
+ # /**
295
+ # * Additional metadata about the diagnostic.
296
+ # */
297
+ # tags?: DiagnosticTag[];
298
+ # /**
299
+ # * An array of related diagnostic information, e.g. when symbol-names within
300
+ # * a scope collide all definitions can be marked via this property.
301
+ # */
302
+ # relatedInformation?: DiagnosticRelatedInformation[];
303
+ # }
304
+ class Diagnostic < LSPBase
305
+ attr_accessor :range, :severity, :code, :source, :message, :tags, :relatedInformation # type: Range # type: DiagnosticSeverity # type: number | string # type: string # type: string # type: DiagnosticTag[] # type: DiagnosticRelatedInformation[]
306
+
307
+ def initialize(initial_hash = nil)
308
+ super
309
+ @optional_method_names = %i[severity code source tags relatedInformation]
310
+ end
311
+
312
+ def from_h!(value)
313
+ value = {} if value.nil?
314
+ self.range = Range.new(value['range']) unless value['range'].nil?
315
+ self.severity = value['severity'] # Unknown type
316
+ self.code = value['code'] # Unknown type
317
+ self.source = value['source']
318
+ self.message = value['message']
319
+ self.tags = value['tags'].map { |val| val } unless value['tags'].nil? # Unknown array type
320
+ self.relatedInformation = to_typed_aray(value['relatedInformation'], DiagnosticRelatedInformation)
321
+ self
322
+ end
323
+ end
324
+
325
+ # export interface Command {
326
+ # /**
327
+ # * Title of the command, like `save`.
328
+ # */
329
+ # title: string;
330
+ # /**
331
+ # * The identifier of the actual command handler.
332
+ # */
333
+ # command: string;
334
+ # /**
335
+ # * Arguments that the command handler should be
336
+ # * invoked with.
337
+ # */
338
+ # arguments?: any[];
339
+ # }
340
+ class Command < LSPBase
341
+ attr_accessor :title, :command, :arguments # type: string # type: string # type: any[]
342
+
343
+ def initialize(initial_hash = nil)
344
+ super
345
+ @optional_method_names = %i[arguments]
346
+ end
347
+
348
+ def from_h!(value)
349
+ value = {} if value.nil?
350
+ self.title = value['title']
351
+ self.command = value['command']
352
+ self.arguments = value['arguments'].map { |val| val } unless value['arguments'].nil?
353
+ self
354
+ end
355
+ end
356
+
357
+ # export interface TextEdit {
358
+ # /**
359
+ # * The range of the text document to be manipulated. To insert
360
+ # * text into a document create a range where start === end.
361
+ # */
362
+ # range: Range;
363
+ # /**
364
+ # * The string to be inserted. For delete operations use an
365
+ # * empty string.
366
+ # */
367
+ # newText: string;
368
+ # }
369
+ class TextEdit < LSPBase
370
+ attr_accessor :range, :newText # type: Range # type: string
371
+
372
+ def from_h!(value)
373
+ value = {} if value.nil?
374
+ self.range = Range.new(value['range']) unless value['range'].nil?
375
+ self.newText = value['newText']
376
+ self
377
+ end
378
+ end
379
+
380
+ # export interface TextDocumentEdit {
381
+ # /**
382
+ # * The text document to change.
383
+ # */
384
+ # textDocument: VersionedTextDocumentIdentifier;
385
+ # /**
386
+ # * The edits to be applied.
387
+ # */
388
+ # edits: TextEdit[];
389
+ # }
390
+ class TextDocumentEdit < LSPBase
391
+ attr_accessor :textDocument, :edits # type: VersionedTextDocumentIdentifier # type: TextEdit[]
392
+
393
+ def from_h!(value)
394
+ value = {} if value.nil?
395
+ self.textDocument = VersionedTextDocumentIdentifier.new(value['textDocument']) unless value['textDocument'].nil?
396
+ self.edits = to_typed_aray(value['edits'], TextEdit)
397
+ self
398
+ end
399
+ end
400
+
401
+ # interface ResourceOperation {
402
+ # kind: string;
403
+ # }
404
+ class ResourceOperation < LSPBase
405
+ attr_accessor :kind # type: string
406
+
407
+ def from_h!(value)
408
+ value = {} if value.nil?
409
+ self.kind = value['kind']
410
+ self
411
+ end
412
+ end
413
+
414
+ # export interface CreateFileOptions {
415
+ # /**
416
+ # * Overwrite existing file. Overwrite wins over `ignoreIfExists`
417
+ # */
418
+ # overwrite?: boolean;
419
+ # /**
420
+ # * Ignore if exists.
421
+ # */
422
+ # ignoreIfExists?: boolean;
423
+ # }
424
+ class CreateFileOptions < LSPBase
425
+ attr_accessor :overwrite, :ignoreIfExists # type: boolean # type: boolean
426
+
427
+ def initialize(initial_hash = nil)
428
+ super
429
+ @optional_method_names = %i[overwrite ignoreIfExists]
430
+ end
431
+
432
+ def from_h!(value)
433
+ value = {} if value.nil?
434
+ self.overwrite = value['overwrite'] # Unknown type
435
+ self.ignoreIfExists = value['ignoreIfExists'] # Unknown type
436
+ self
437
+ end
438
+ end
439
+
440
+ # export interface CreateFile extends ResourceOperation {
441
+ # /**
442
+ # * A create
443
+ # */
444
+ # kind: 'create';
445
+ # /**
446
+ # * The resource to create.
447
+ # */
448
+ # uri: DocumentUri;
449
+ # /**
450
+ # * Additional options
451
+ # */
452
+ # options?: CreateFileOptions;
453
+ # }
454
+ class CreateFile < LSPBase
455
+ attr_accessor :kind, :uri, :options # type: string with value 'create' # type: DocumentUri # type: CreateFileOptions
456
+
457
+ def initialize(initial_hash = nil)
458
+ super
459
+ @optional_method_names = %i[options]
460
+ end
461
+
462
+ def from_h!(value)
463
+ value = {} if value.nil?
464
+ self.kind = value['kind'] # Unknown type
465
+ self.uri = value['uri'] # Unknown type
466
+ self.options = CreateFileOptions.new(value['options']) unless value['options'].nil?
467
+ self
468
+ end
469
+ end
470
+
471
+ # export interface RenameFileOptions {
472
+ # /**
473
+ # * Overwrite target if existing. Overwrite wins over `ignoreIfExists`
474
+ # */
475
+ # overwrite?: boolean;
476
+ # /**
477
+ # * Ignores if target exists.
478
+ # */
479
+ # ignoreIfExists?: boolean;
480
+ # }
481
+ class RenameFileOptions < LSPBase
482
+ attr_accessor :overwrite, :ignoreIfExists # type: boolean # type: boolean
483
+
484
+ def initialize(initial_hash = nil)
485
+ super
486
+ @optional_method_names = %i[overwrite ignoreIfExists]
487
+ end
488
+
489
+ def from_h!(value)
490
+ value = {} if value.nil?
491
+ self.overwrite = value['overwrite'] # Unknown type
492
+ self.ignoreIfExists = value['ignoreIfExists'] # Unknown type
493
+ self
494
+ end
495
+ end
496
+
497
+ # export interface RenameFile extends ResourceOperation {
498
+ # /**
499
+ # * A rename
500
+ # */
501
+ # kind: 'rename';
502
+ # /**
503
+ # * The old (existing) location.
504
+ # */
505
+ # oldUri: DocumentUri;
506
+ # /**
507
+ # * The new location.
508
+ # */
509
+ # newUri: DocumentUri;
510
+ # /**
511
+ # * Rename options.
512
+ # */
513
+ # options?: RenameFileOptions;
514
+ # }
515
+ class RenameFile < LSPBase
516
+ attr_accessor :kind, :oldUri, :newUri, :options # type: string with value 'rename' # type: DocumentUri # type: DocumentUri # type: RenameFileOptions
517
+
518
+ def initialize(initial_hash = nil)
519
+ super
520
+ @optional_method_names = %i[options]
521
+ end
522
+
523
+ def from_h!(value)
524
+ value = {} if value.nil?
525
+ self.kind = value['kind'] # Unknown type
526
+ self.oldUri = value['oldUri'] # Unknown type
527
+ self.newUri = value['newUri'] # Unknown type
528
+ self.options = RenameFileOptions.new(value['options']) unless value['options'].nil?
529
+ self
530
+ end
531
+ end
532
+
533
+ # export interface DeleteFileOptions {
534
+ # /**
535
+ # * Delete the content recursively if a folder is denoted.
536
+ # */
537
+ # recursive?: boolean;
538
+ # /**
539
+ # * Ignore the operation if the file doesn't exist.
540
+ # */
541
+ # ignoreIfNotExists?: boolean;
542
+ # }
543
+ class DeleteFileOptions < LSPBase
544
+ attr_accessor :recursive, :ignoreIfNotExists # type: boolean # type: boolean
545
+
546
+ def initialize(initial_hash = nil)
547
+ super
548
+ @optional_method_names = %i[recursive ignoreIfNotExists]
549
+ end
550
+
551
+ def from_h!(value)
552
+ value = {} if value.nil?
553
+ self.recursive = value['recursive'] # Unknown type
554
+ self.ignoreIfNotExists = value['ignoreIfNotExists'] # Unknown type
555
+ self
556
+ end
557
+ end
558
+
559
+ # export interface DeleteFile extends ResourceOperation {
560
+ # /**
561
+ # * A delete
562
+ # */
563
+ # kind: 'delete';
564
+ # /**
565
+ # * The file to delete.
566
+ # */
567
+ # uri: DocumentUri;
568
+ # /**
569
+ # * Delete options.
570
+ # */
571
+ # options?: DeleteFileOptions;
572
+ # }
573
+ class DeleteFile < LSPBase
574
+ attr_accessor :kind, :uri, :options # type: string with value 'delete' # type: DocumentUri # type: DeleteFileOptions
575
+
576
+ def initialize(initial_hash = nil)
577
+ super
578
+ @optional_method_names = %i[options]
579
+ end
580
+
581
+ def from_h!(value)
582
+ value = {} if value.nil?
583
+ self.kind = value['kind'] # Unknown type
584
+ self.uri = value['uri'] # Unknown type
585
+ self.options = DeleteFileOptions.new(value['options']) unless value['options'].nil?
586
+ self
587
+ end
588
+ end
589
+
590
+ # export interface WorkspaceEdit {
591
+ # /**
592
+ # * Holds changes to existing resources.
593
+ # */
594
+ # changes?: {
595
+ # [uri: string]: TextEdit[];
596
+ # };
597
+ # /**
598
+ # * Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes
599
+ # * are either an array of `TextDocumentEdit`s to express changes to n different text documents
600
+ # * where each text document edit addresses a specific version of a text document. Or it can contain
601
+ # * above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.
602
+ # *
603
+ # * Whether a client supports versioned document edits is expressed via
604
+ # * `workspace.workspaceEdit.documentChanges` client capability.
605
+ # *
606
+ # * If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then
607
+ # * only plain `TextEdit`s using the `changes` property are supported.
608
+ # */
609
+ # documentChanges?: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[];
610
+ # }
611
+ class WorkspaceEdit < LSPBase
612
+ attr_accessor :changes # type: {
613
+ # [uri: string]: TextEdit[];
614
+ # }
615
+ attr_accessor :documentChanges # type: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[]
616
+
617
+ def initialize(initial_hash = nil)
618
+ super
619
+ @optional_method_names = %i[changes documentChanges]
620
+ end
621
+
622
+ def from_h!(value)
623
+ value = {} if value.nil?
624
+ self.changes = value['changes'] # Unknown type
625
+ self.documentChanges = value['documentChanges'] # Unknown type
626
+ self
627
+ end
628
+ end
629
+
630
+ # export declare class WorkspaceChange {
631
+ # private _workspaceEdit;
632
+ # private _textEditChanges;
633
+ # constructor(workspaceEdit?: WorkspaceEdit);
634
+ # /**
635
+ # * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal
636
+ # * use to be returned from a workspace edit operation like rename.
637
+ # */
638
+ # get edit(): WorkspaceEdit;
639
+ # /**
640
+ # * Returns the [TextEditChange](#TextEditChange) to manage text edits
641
+ # * for resources.
642
+ # */
643
+ # getTextEditChange(textDocument: VersionedTextDocumentIdentifier): TextEditChange;
644
+ # getTextEditChange(uri: DocumentUri): TextEditChange;
645
+ # createFile(uri: DocumentUri, options?: CreateFileOptions): void;
646
+ # renameFile(oldUri: DocumentUri, newUri: DocumentUri, options?: RenameFileOptions): void;
647
+ # deleteFile(uri: DocumentUri, options?: DeleteFileOptions): void;
648
+ # private checkDocumentChanges;
649
+ # }
650
+ class WorkspaceChange < LSPBase
651
+
652
+ def from_h!(value)
653
+ value = {} if value.nil?
654
+ self
655
+ end
656
+ end
657
+
658
+ # export interface TextDocumentIdentifier {
659
+ # /**
660
+ # * The text document's uri.
661
+ # */
662
+ # uri: DocumentUri;
663
+ # }
664
+ class TextDocumentIdentifier < LSPBase
665
+ attr_accessor :uri # type: DocumentUri
666
+
667
+ def from_h!(value)
668
+ value = {} if value.nil?
669
+ self.uri = value['uri'] # Unknown type
670
+ self
671
+ end
672
+ end
673
+
674
+ # export interface VersionedTextDocumentIdentifier extends TextDocumentIdentifier {
675
+ # /**
676
+ # * The version number of this document. If a versioned text document identifier
677
+ # * is sent from the server to the client and the file is not open in the editor
678
+ # * (the server has not received an open notification before) the server can send
679
+ # * `null` to indicate that the version is unknown and the content on disk is the
680
+ # * truth (as speced with document content ownership).
681
+ # */
682
+ # version: number | null;
683
+ # }
684
+ class VersionedTextDocumentIdentifier < LSPBase
685
+ attr_accessor :version, :uri # type: number | null # type: DocumentUri
686
+
687
+ def from_h!(value)
688
+ value = {} if value.nil?
689
+ self.version = value['version'] # Unknown type
690
+ self.uri = value['uri'] # Unknown type
691
+ self
692
+ end
693
+ end
694
+
695
+ # export interface TextDocumentItem {
696
+ # /**
697
+ # * The text document's uri.
698
+ # */
699
+ # uri: DocumentUri;
700
+ # /**
701
+ # * The text document's language identifier
702
+ # */
703
+ # languageId: string;
704
+ # /**
705
+ # * The version number of this document (it will increase after each
706
+ # * change, including undo/redo).
707
+ # */
708
+ # version: number;
709
+ # /**
710
+ # * The content of the opened text document.
711
+ # */
712
+ # text: string;
713
+ # }
714
+ class TextDocumentItem < LSPBase
715
+ attr_accessor :uri, :languageId, :version, :text # type: DocumentUri # type: string # type: number # type: string
716
+
717
+ def from_h!(value)
718
+ value = {} if value.nil?
719
+ self.uri = value['uri'] # Unknown type
720
+ self.languageId = value['languageId']
721
+ self.version = value['version']
722
+ self.text = value['text']
723
+ self
724
+ end
725
+ end
726
+
727
+ # export interface MarkupContent {
728
+ # /**
729
+ # * The type of the Markup
730
+ # */
731
+ # kind: MarkupKind;
732
+ # /**
733
+ # * The content itself
734
+ # */
735
+ # value: string;
736
+ # }
737
+ class MarkupContent < LSPBase
738
+ attr_accessor :kind, :value # type: MarkupKind # type: string
739
+
740
+ def from_h!(value)
741
+ value = {} if value.nil?
742
+ self.kind = value['kind'] # Unknown type
743
+ self.value = value['value']
744
+ self
745
+ end
746
+ end
747
+
748
+ # export interface CompletionItem {
749
+ # /**
750
+ # * The label of this completion item. By default
751
+ # * also the text that is inserted when selecting
752
+ # * this completion.
753
+ # */
754
+ # label: string;
755
+ # /**
756
+ # * The kind of this completion item. Based of the kind
757
+ # * an icon is chosen by the editor.
758
+ # */
759
+ # kind?: CompletionItemKind;
760
+ # /**
761
+ # * Tags for this completion item.
762
+ # *
763
+ # * @since 3.15.0
764
+ # */
765
+ # tags?: CompletionItemTag[];
766
+ # /**
767
+ # * A human-readable string with additional information
768
+ # * about this item, like type or symbol information.
769
+ # */
770
+ # detail?: string;
771
+ # /**
772
+ # * A human-readable string that represents a doc-comment.
773
+ # */
774
+ # documentation?: string | MarkupContent;
775
+ # /**
776
+ # * Indicates if this item is deprecated.
777
+ # * @deprecated Use `tags` instead.
778
+ # */
779
+ # deprecated?: boolean;
780
+ # /**
781
+ # * Select this item when showing.
782
+ # *
783
+ # * *Note* that only one completion item can be selected and that the
784
+ # * tool / client decides which item that is. The rule is that the *first*
785
+ # * item of those that match best is selected.
786
+ # */
787
+ # preselect?: boolean;
788
+ # /**
789
+ # * A string that should be used when comparing this item
790
+ # * with other items. When `falsy` the [label](#CompletionItem.label)
791
+ # * is used.
792
+ # */
793
+ # sortText?: string;
794
+ # /**
795
+ # * A string that should be used when filtering a set of
796
+ # * completion items. When `falsy` the [label](#CompletionItem.label)
797
+ # * is used.
798
+ # */
799
+ # filterText?: string;
800
+ # /**
801
+ # * A string that should be inserted into a document when selecting
802
+ # * this completion. When `falsy` the [label](#CompletionItem.label)
803
+ # * is used.
804
+ # *
805
+ # * The `insertText` is subject to interpretation by the client side.
806
+ # * Some tools might not take the string literally. For example
807
+ # * VS Code when code complete is requested in this example `con<cursor position>`
808
+ # * and a completion item with an `insertText` of `console` is provided it
809
+ # * will only insert `sole`. Therefore it is recommended to use `textEdit` instead
810
+ # * since it avoids additional client side interpretation.
811
+ # */
812
+ # insertText?: string;
813
+ # /**
814
+ # * The format of the insert text. The format applies to both the `insertText` property
815
+ # * and the `newText` property of a provided `textEdit`. If ommitted defaults to
816
+ # * `InsertTextFormat.PlainText`.
817
+ # */
818
+ # insertTextFormat?: InsertTextFormat;
819
+ # /**
820
+ # * An [edit](#TextEdit) which is applied to a document when selecting
821
+ # * this completion. When an edit is provided the value of
822
+ # * [insertText](#CompletionItem.insertText) is ignored.
823
+ # *
824
+ # * *Note:* The text edit's range must be a [single line] and it must contain the position
825
+ # * at which completion has been requested.
826
+ # */
827
+ # textEdit?: TextEdit;
828
+ # /**
829
+ # * An optional array of additional [text edits](#TextEdit) that are applied when
830
+ # * selecting this completion. Edits must not overlap (including the same insert position)
831
+ # * with the main [edit](#CompletionItem.textEdit) nor with themselves.
832
+ # *
833
+ # * Additional text edits should be used to change text unrelated to the current cursor position
834
+ # * (for example adding an import statement at the top of the file if the completion item will
835
+ # * insert an unqualified type).
836
+ # */
837
+ # additionalTextEdits?: TextEdit[];
838
+ # /**
839
+ # * An optional set of characters that when pressed while this completion is active will accept it first and
840
+ # * then type that character. *Note* that all commit characters should have `length=1` and that superfluous
841
+ # * characters will be ignored.
842
+ # */
843
+ # commitCharacters?: string[];
844
+ # /**
845
+ # * An optional [command](#Command) that is executed *after* inserting this completion. *Note* that
846
+ # * additional modifications to the current document should be described with the
847
+ # * [additionalTextEdits](#CompletionItem.additionalTextEdits)-property.
848
+ # */
849
+ # command?: Command;
850
+ # /**
851
+ # * An data entry field that is preserved on a completion item between
852
+ # * a [CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest]
853
+ # * (#CompletionResolveRequest)
854
+ # */
855
+ # data?: any;
856
+ # }
857
+ class CompletionItem < LSPBase
858
+ attr_accessor :label, :kind, :tags, :detail, :documentation, :deprecated, :preselect, :sortText, :filterText, :insertText, :insertTextFormat, :textEdit, :additionalTextEdits, :commitCharacters, :command, :data # type: string # type: CompletionItemKind # type: CompletionItemTag[] # type: string # type: string | MarkupContent # type: boolean # type: boolean # type: string # type: string # type: string # type: InsertTextFormat # type: TextEdit # type: TextEdit[] # type: string[] # type: Command # type: any
859
+
860
+ def initialize(initial_hash = nil)
861
+ super
862
+ @optional_method_names = %i[kind tags detail documentation deprecated preselect sortText filterText insertText insertTextFormat textEdit additionalTextEdits commitCharacters command data]
863
+ end
864
+
865
+ def from_h!(value)
866
+ value = {} if value.nil?
867
+ self.label = value['label']
868
+ self.kind = value['kind'] # Unknown type
869
+ self.tags = value['tags'].map { |val| val } unless value['tags'].nil? # Unknown array type
870
+ self.detail = value['detail']
871
+ self.documentation = value['documentation'] # Unknown type
872
+ self.deprecated = value['deprecated'] # Unknown type
873
+ self.preselect = value['preselect'] # Unknown type
874
+ self.sortText = value['sortText']
875
+ self.filterText = value['filterText']
876
+ self.insertText = value['insertText']
877
+ self.insertTextFormat = value['insertTextFormat'] # Unknown type
878
+ self.textEdit = TextEdit.new(value['textEdit']) unless value['textEdit'].nil?
879
+ self.additionalTextEdits = to_typed_aray(value['additionalTextEdits'], TextEdit)
880
+ self.commitCharacters = value['commitCharacters'].map { |val| val } unless value['commitCharacters'].nil?
881
+ self.command = Command.new(value['command']) unless value['command'].nil?
882
+ self.data = value['data']
883
+ self
884
+ end
885
+ end
886
+
887
+ # export interface CompletionList {
888
+ # /**
889
+ # * This list it not complete. Further typing results in recomputing this list.
890
+ # */
891
+ # isIncomplete: boolean;
892
+ # /**
893
+ # * The completion items.
894
+ # */
895
+ # items: CompletionItem[];
896
+ # }
897
+ class CompletionList < LSPBase
898
+ attr_accessor :isIncomplete, :items # type: boolean # type: CompletionItem[]
899
+
900
+ def from_h!(value)
901
+ value = {} if value.nil?
902
+ self.isIncomplete = value['isIncomplete'] # Unknown type
903
+ self.items = to_typed_aray(value['items'], CompletionItem)
904
+ self
905
+ end
906
+ end
907
+
908
+ # export interface Hover {
909
+ # /**
910
+ # * The hover's content
911
+ # */
912
+ # contents: MarkupContent | MarkedString | MarkedString[];
913
+ # /**
914
+ # * An optional range
915
+ # */
916
+ # range?: Range;
917
+ # }
918
+ class Hover < LSPBase
919
+ attr_accessor :contents, :range # type: MarkupContent | MarkedString | MarkedString[] # type: Range
920
+
921
+ def initialize(initial_hash = nil)
922
+ super
923
+ @optional_method_names = %i[range]
924
+ end
925
+
926
+ def from_h!(value)
927
+ value = {} if value.nil?
928
+ self.contents = value['contents'] # Unknown type
929
+ self.range = Range.new(value['range']) unless value['range'].nil?
930
+ self
931
+ end
932
+ end
933
+
934
+ # export interface ParameterInformation {
935
+ # /**
936
+ # * The label of this parameter information.
937
+ # *
938
+ # * Either a string or an inclusive start and exclusive end offsets within its containing
939
+ # * signature label. (see SignatureInformation.label). The offsets are based on a UTF-16
940
+ # * string representation as `Position` and `Range` does.
941
+ # *
942
+ # * *Note*: a label of type string should be a substring of its containing signature label.
943
+ # * Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.
944
+ # */
945
+ # label: string | [number, number];
946
+ # /**
947
+ # * The human-readable doc-comment of this signature. Will be shown
948
+ # * in the UI but can be omitted.
949
+ # */
950
+ # documentation?: string | MarkupContent;
951
+ # }
952
+ class ParameterInformation < LSPBase
953
+ attr_accessor :label, :documentation # type: string | [number, number] # type: string | MarkupContent
954
+
955
+ def initialize(initial_hash = nil)
956
+ super
957
+ @optional_method_names = %i[documentation]
958
+ end
959
+
960
+ def from_h!(value)
961
+ value = {} if value.nil?
962
+ self.label = value['label'] # Unknown type
963
+ self.documentation = value['documentation'] # Unknown type
964
+ self
965
+ end
966
+ end
967
+
968
+ # export interface SignatureInformation {
969
+ # /**
970
+ # * The label of this signature. Will be shown in
971
+ # * the UI.
972
+ # */
973
+ # label: string;
974
+ # /**
975
+ # * The human-readable doc-comment of this signature. Will be shown
976
+ # * in the UI but can be omitted.
977
+ # */
978
+ # documentation?: string | MarkupContent;
979
+ # /**
980
+ # * The parameters of this signature.
981
+ # */
982
+ # parameters?: ParameterInformation[];
983
+ # }
984
+ class SignatureInformation < LSPBase
985
+ attr_accessor :label, :documentation, :parameters # type: string # type: string | MarkupContent # type: ParameterInformation[]
986
+
987
+ def initialize(initial_hash = nil)
988
+ super
989
+ @optional_method_names = %i[documentation parameters]
990
+ end
991
+
992
+ def from_h!(value)
993
+ value = {} if value.nil?
994
+ self.label = value['label']
995
+ self.documentation = value['documentation'] # Unknown type
996
+ self.parameters = to_typed_aray(value['parameters'], ParameterInformation)
997
+ self
998
+ end
999
+ end
1000
+
1001
+ # export interface SignatureHelp {
1002
+ # /**
1003
+ # * One or more signatures.
1004
+ # */
1005
+ # signatures: SignatureInformation[];
1006
+ # /**
1007
+ # * The active signature. Set to `null` if no
1008
+ # * signatures exist.
1009
+ # */
1010
+ # activeSignature: number | null;
1011
+ # /**
1012
+ # * The active parameter of the active signature. Set to `null`
1013
+ # * if the active signature has no parameters.
1014
+ # */
1015
+ # activeParameter: number | null;
1016
+ # }
1017
+ class SignatureHelp < LSPBase
1018
+ attr_accessor :signatures, :activeSignature, :activeParameter # type: SignatureInformation[] # type: number | null # type: number | null
1019
+
1020
+ def from_h!(value)
1021
+ value = {} if value.nil?
1022
+ self.signatures = to_typed_aray(value['signatures'], SignatureInformation)
1023
+ self.activeSignature = value['activeSignature'] # Unknown type
1024
+ self.activeParameter = value['activeParameter'] # Unknown type
1025
+ self
1026
+ end
1027
+ end
1028
+
1029
+ # export interface ReferenceContext {
1030
+ # /**
1031
+ # * Include the declaration of the current symbol.
1032
+ # */
1033
+ # includeDeclaration: boolean;
1034
+ # }
1035
+ class ReferenceContext < LSPBase
1036
+ attr_accessor :includeDeclaration # type: boolean
1037
+
1038
+ def from_h!(value)
1039
+ value = {} if value.nil?
1040
+ self.includeDeclaration = value['includeDeclaration'] # Unknown type
1041
+ self
1042
+ end
1043
+ end
1044
+
1045
+ # export interface DocumentHighlight {
1046
+ # /**
1047
+ # * The range this highlight applies to.
1048
+ # */
1049
+ # range: Range;
1050
+ # /**
1051
+ # * The highlight kind, default is [text](#DocumentHighlightKind.Text).
1052
+ # */
1053
+ # kind?: DocumentHighlightKind;
1054
+ # }
1055
+ class DocumentHighlight < LSPBase
1056
+ attr_accessor :range, :kind # type: Range # type: DocumentHighlightKind
1057
+
1058
+ def initialize(initial_hash = nil)
1059
+ super
1060
+ @optional_method_names = %i[kind]
1061
+ end
1062
+
1063
+ def from_h!(value)
1064
+ value = {} if value.nil?
1065
+ self.range = Range.new(value['range']) unless value['range'].nil?
1066
+ self.kind = value['kind'] # Unknown type
1067
+ self
1068
+ end
1069
+ end
1070
+
1071
+ # export interface SymbolInformation {
1072
+ # /**
1073
+ # * The name of this symbol.
1074
+ # */
1075
+ # name: string;
1076
+ # /**
1077
+ # * The kind of this symbol.
1078
+ # */
1079
+ # kind: SymbolKind;
1080
+ # /**
1081
+ # * Indicates if this symbol is deprecated.
1082
+ # */
1083
+ # deprecated?: boolean;
1084
+ # /**
1085
+ # * The location of this symbol. The location's range is used by a tool
1086
+ # * to reveal the location in the editor. If the symbol is selected in the
1087
+ # * tool the range's start information is used to position the cursor. So
1088
+ # * the range usually spans more than the actual symbol's name and does
1089
+ # * normally include thinks like visibility modifiers.
1090
+ # *
1091
+ # * The range doesn't have to denote a node range in the sense of a abstract
1092
+ # * syntax tree. It can therefore not be used to re-construct a hierarchy of
1093
+ # * the symbols.
1094
+ # */
1095
+ # location: Location;
1096
+ # /**
1097
+ # * The name of the symbol containing this symbol. This information is for
1098
+ # * user interface purposes (e.g. to render a qualifier in the user interface
1099
+ # * if necessary). It can't be used to re-infer a hierarchy for the document
1100
+ # * symbols.
1101
+ # */
1102
+ # containerName?: string;
1103
+ # }
1104
+ class SymbolInformation < LSPBase
1105
+ attr_accessor :name, :kind, :deprecated, :location, :containerName # type: string # type: SymbolKind # type: boolean # type: Location # type: string
1106
+
1107
+ def initialize(initial_hash = nil)
1108
+ super
1109
+ @optional_method_names = %i[deprecated containerName]
1110
+ end
1111
+
1112
+ def from_h!(value)
1113
+ value = {} if value.nil?
1114
+ self.name = value['name']
1115
+ self.kind = value['kind'] # Unknown type
1116
+ self.deprecated = value['deprecated'] # Unknown type
1117
+ self.location = Location.new(value['location']) unless value['location'].nil?
1118
+ self.containerName = value['containerName']
1119
+ self
1120
+ end
1121
+ end
1122
+
1123
+ # export interface DocumentSymbol {
1124
+ # /**
1125
+ # * The name of this symbol. Will be displayed in the user interface and therefore must not be
1126
+ # * an empty string or a string only consisting of white spaces.
1127
+ # */
1128
+ # name: string;
1129
+ # /**
1130
+ # * More detail for this symbol, e.g the signature of a function.
1131
+ # */
1132
+ # detail?: string;
1133
+ # /**
1134
+ # * The kind of this symbol.
1135
+ # */
1136
+ # kind: SymbolKind;
1137
+ # /**
1138
+ # * Indicates if this symbol is deprecated.
1139
+ # */
1140
+ # deprecated?: boolean;
1141
+ # /**
1142
+ # * The range enclosing this symbol not including leading/trailing whitespace but everything else
1143
+ # * like comments. This information is typically used to determine if the the clients cursor is
1144
+ # * inside the symbol to reveal in the symbol in the UI.
1145
+ # */
1146
+ # range: Range;
1147
+ # /**
1148
+ # * The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.
1149
+ # * Must be contained by the the `range`.
1150
+ # */
1151
+ # selectionRange: Range;
1152
+ # /**
1153
+ # * Children of this symbol, e.g. properties of a class.
1154
+ # */
1155
+ # children?: DocumentSymbol[];
1156
+ # }
1157
+ class DocumentSymbol < LSPBase
1158
+ attr_accessor :name, :detail, :kind, :deprecated, :range, :selectionRange, :children # type: string # type: string # type: SymbolKind # type: boolean # type: Range # type: Range # type: DocumentSymbol[]
1159
+
1160
+ def initialize(initial_hash = nil)
1161
+ super
1162
+ @optional_method_names = %i[detail deprecated children]
1163
+ end
1164
+
1165
+ def from_h!(value)
1166
+ value = {} if value.nil?
1167
+ self.name = value['name']
1168
+ self.detail = value['detail']
1169
+ self.kind = value['kind'] # Unknown type
1170
+ self.deprecated = value['deprecated'] # Unknown type
1171
+ self.range = Range.new(value['range']) unless value['range'].nil?
1172
+ self.selectionRange = Range.new(value['selectionRange']) unless value['selectionRange'].nil?
1173
+ self.children = to_typed_aray(value['children'], DocumentSymbol)
1174
+ self
1175
+ end
1176
+ end
1177
+
1178
+ # export interface CodeActionContext {
1179
+ # /**
1180
+ # * An array of diagnostics known on the client side overlapping the range provided to the
1181
+ # * `textDocument/codeAction` request. They are provied so that the server knows which
1182
+ # * errors are currently presented to the user for the given range. There is no guarantee
1183
+ # * that these accurately reflect the error state of the resource. The primary parameter
1184
+ # * to compute code actions is the provided range.
1185
+ # */
1186
+ # diagnostics: Diagnostic[];
1187
+ # /**
1188
+ # * Requested kind of actions to return.
1189
+ # *
1190
+ # * Actions not of this kind are filtered out by the client before being shown. So servers
1191
+ # * can omit computing them.
1192
+ # */
1193
+ # only?: CodeActionKind[];
1194
+ # }
1195
+ class CodeActionContext < LSPBase
1196
+ attr_accessor :diagnostics, :only # type: Diagnostic[] # type: CodeActionKind[]
1197
+
1198
+ def initialize(initial_hash = nil)
1199
+ super
1200
+ @optional_method_names = %i[only]
1201
+ end
1202
+
1203
+ def from_h!(value)
1204
+ value = {} if value.nil?
1205
+ self.diagnostics = to_typed_aray(value['diagnostics'], Diagnostic)
1206
+ self.only = value['only'].map { |val| val } unless value['only'].nil? # Unknown array type
1207
+ self
1208
+ end
1209
+ end
1210
+
1211
+ # export interface CodeAction {
1212
+ # /**
1213
+ # * A short, human-readable, title for this code action.
1214
+ # */
1215
+ # title: string;
1216
+ # /**
1217
+ # * The kind of the code action.
1218
+ # *
1219
+ # * Used to filter code actions.
1220
+ # */
1221
+ # kind?: CodeActionKind;
1222
+ # /**
1223
+ # * The diagnostics that this code action resolves.
1224
+ # */
1225
+ # diagnostics?: Diagnostic[];
1226
+ # /**
1227
+ # * Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted
1228
+ # * by keybindings.
1229
+ # *
1230
+ # * A quick fix should be marked preferred if it properly addresses the underlying error.
1231
+ # * A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
1232
+ # *
1233
+ # * @since 3.15.0
1234
+ # */
1235
+ # isPreferred?: boolean;
1236
+ # /**
1237
+ # * The workspace edit this code action performs.
1238
+ # */
1239
+ # edit?: WorkspaceEdit;
1240
+ # /**
1241
+ # * A command this code action executes. If a code action
1242
+ # * provides a edit and a command, first the edit is
1243
+ # * executed and then the command.
1244
+ # */
1245
+ # command?: Command;
1246
+ # }
1247
+ class CodeAction < LSPBase
1248
+ attr_accessor :title, :kind, :diagnostics, :isPreferred, :edit, :command # type: string # type: CodeActionKind # type: Diagnostic[] # type: boolean # type: WorkspaceEdit # type: Command
1249
+
1250
+ def initialize(initial_hash = nil)
1251
+ super
1252
+ @optional_method_names = %i[kind diagnostics isPreferred edit command]
1253
+ end
1254
+
1255
+ def from_h!(value)
1256
+ value = {} if value.nil?
1257
+ self.title = value['title']
1258
+ self.kind = value['kind'] # Unknown type
1259
+ self.diagnostics = to_typed_aray(value['diagnostics'], Diagnostic)
1260
+ self.isPreferred = value['isPreferred'] # Unknown type
1261
+ self.edit = WorkspaceEdit.new(value['edit']) unless value['edit'].nil?
1262
+ self.command = Command.new(value['command']) unless value['command'].nil?
1263
+ self
1264
+ end
1265
+ end
1266
+
1267
+ # export interface CodeLens {
1268
+ # /**
1269
+ # * The range in which this code lens is valid. Should only span a single line.
1270
+ # */
1271
+ # range: Range;
1272
+ # /**
1273
+ # * The command this code lens represents.
1274
+ # */
1275
+ # command?: Command;
1276
+ # /**
1277
+ # * An data entry field that is preserved on a code lens item between
1278
+ # * a [CodeLensRequest](#CodeLensRequest) and a [CodeLensResolveRequest]
1279
+ # * (#CodeLensResolveRequest)
1280
+ # */
1281
+ # data?: any;
1282
+ # }
1283
+ class CodeLens < LSPBase
1284
+ attr_accessor :range, :command, :data # type: Range # type: Command # type: any
1285
+
1286
+ def initialize(initial_hash = nil)
1287
+ super
1288
+ @optional_method_names = %i[command data]
1289
+ end
1290
+
1291
+ def from_h!(value)
1292
+ value = {} if value.nil?
1293
+ self.range = Range.new(value['range']) unless value['range'].nil?
1294
+ self.command = Command.new(value['command']) unless value['command'].nil?
1295
+ self.data = value['data']
1296
+ self
1297
+ end
1298
+ end
1299
+
1300
+ # export interface FormattingOptions {
1301
+ # /**
1302
+ # * Size of a tab in spaces.
1303
+ # */
1304
+ # tabSize: number;
1305
+ # /**
1306
+ # * Prefer spaces over tabs.
1307
+ # */
1308
+ # insertSpaces: boolean;
1309
+ # /**
1310
+ # * Trim trailing whitespaces on a line.
1311
+ # *
1312
+ # * @since 3.15.0
1313
+ # */
1314
+ # trimTrailingWhitespace?: boolean;
1315
+ # /**
1316
+ # * Insert a newline character at the end of the file if one does not exist.
1317
+ # *
1318
+ # * @since 3.15.0
1319
+ # */
1320
+ # insertFinalNewline?: boolean;
1321
+ # /**
1322
+ # * Trim all newlines after the final newline at the end of the file.
1323
+ # *
1324
+ # * @since 3.15.0
1325
+ # */
1326
+ # trimFinalNewlines?: boolean;
1327
+ # /**
1328
+ # * Signature for further properties.
1329
+ # */
1330
+ # [key: string]: boolean | number | string | undefined;
1331
+ # }
1332
+ class FormattingOptions < LSPBase
1333
+ attr_accessor :tabSize, :insertSpaces, :trimTrailingWhitespace, :insertFinalNewline, :trimFinalNewlines # type: number # type: boolean # type: boolean # type: boolean # type: boolean
1334
+
1335
+ def initialize(initial_hash = nil)
1336
+ super
1337
+ @optional_method_names = %i[trimTrailingWhitespace insertFinalNewline trimFinalNewlines]
1338
+ end
1339
+
1340
+ def from_h!(value)
1341
+ value = {} if value.nil?
1342
+ self.tabSize = value['tabSize']
1343
+ self.insertSpaces = value['insertSpaces'] # Unknown type
1344
+ self.trimTrailingWhitespace = value['trimTrailingWhitespace'] # Unknown type
1345
+ self.insertFinalNewline = value['insertFinalNewline'] # Unknown type
1346
+ self.trimFinalNewlines = value['trimFinalNewlines'] # Unknown type
1347
+ self
1348
+ end
1349
+ end
1350
+
1351
+ # export interface DocumentLink {
1352
+ # /**
1353
+ # * The range this link applies to.
1354
+ # */
1355
+ # range: Range;
1356
+ # /**
1357
+ # * The uri this link points to.
1358
+ # */
1359
+ # target?: string;
1360
+ # /**
1361
+ # * The tooltip text when you hover over this link.
1362
+ # *
1363
+ # * If a tooltip is provided, is will be displayed in a string that includes instructions on how to
1364
+ # * trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,
1365
+ # * user settings, and localization.
1366
+ # *
1367
+ # * @since 3.15.0
1368
+ # */
1369
+ # tooltip?: string;
1370
+ # /**
1371
+ # * A data entry field that is preserved on a document link between a
1372
+ # * DocumentLinkRequest and a DocumentLinkResolveRequest.
1373
+ # */
1374
+ # data?: any;
1375
+ # }
1376
+ class DocumentLink < LSPBase
1377
+ attr_accessor :range, :target, :tooltip, :data # type: Range # type: string # type: string # type: any
1378
+
1379
+ def initialize(initial_hash = nil)
1380
+ super
1381
+ @optional_method_names = %i[target tooltip data]
1382
+ end
1383
+
1384
+ def from_h!(value)
1385
+ value = {} if value.nil?
1386
+ self.range = Range.new(value['range']) unless value['range'].nil?
1387
+ self.target = value['target']
1388
+ self.tooltip = value['tooltip']
1389
+ self.data = value['data']
1390
+ self
1391
+ end
1392
+ end
1393
+
1394
+ # export interface SelectionRange {
1395
+ # /**
1396
+ # * The [range](#Range) of this selection range.
1397
+ # */
1398
+ # range: Range;
1399
+ # /**
1400
+ # * The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
1401
+ # */
1402
+ # parent?: SelectionRange;
1403
+ # }
1404
+ class SelectionRange < LSPBase
1405
+ attr_accessor :range, :parent # type: Range # type: SelectionRange
1406
+
1407
+ def initialize(initial_hash = nil)
1408
+ super
1409
+ @optional_method_names = %i[parent]
1410
+ end
1411
+
1412
+ def from_h!(value)
1413
+ value = {} if value.nil?
1414
+ self.range = Range.new(value['range']) unless value['range'].nil?
1415
+ self.parent = SelectionRange.new(value['parent']) unless value['parent'].nil?
1416
+ self
1417
+ end
1418
+ end
1419
+
1420
+ # export interface TextDocument {
1421
+ # /**
1422
+ # * The associated URI for this document. Most documents have the __file__-scheme, indicating that they
1423
+ # * represent files on disk. However, some documents may have other schemes indicating that they are not
1424
+ # * available on disk.
1425
+ # *
1426
+ # * @readonly
1427
+ # */
1428
+ # readonly uri: DocumentUri;
1429
+ # /**
1430
+ # * The identifier of the language associated with this document.
1431
+ # *
1432
+ # * @readonly
1433
+ # */
1434
+ # readonly languageId: string;
1435
+ # /**
1436
+ # * The version number of this document (it will increase after each
1437
+ # * change, including undo/redo).
1438
+ # *
1439
+ # * @readonly
1440
+ # */
1441
+ # readonly version: number;
1442
+ # /**
1443
+ # * Get the text of this document. A substring can be retrieved by
1444
+ # * providing a range.
1445
+ # *
1446
+ # * @param range (optional) An range within the document to return.
1447
+ # * If no range is passed, the full content is returned.
1448
+ # * Invalid range positions are adjusted as described in [Position.line](#Position.line)
1449
+ # * and [Position.character](#Position.character).
1450
+ # * If the start range position is greater than the end range position,
1451
+ # * then the effect of getText is as if the two positions were swapped.
1452
+ #
1453
+ # * @return The text of this document or a substring of the text if a
1454
+ # * range is provided.
1455
+ # */
1456
+ # getText(range?: Range): string;
1457
+ # /**
1458
+ # * Converts a zero-based offset to a position.
1459
+ # *
1460
+ # * @param offset A zero-based offset.
1461
+ # * @return A valid [position](#Position).
1462
+ # */
1463
+ # positionAt(offset: number): Position;
1464
+ # /**
1465
+ # * Converts the position to a zero-based offset.
1466
+ # * Invalid positions are adjusted as described in [Position.line](#Position.line)
1467
+ # * and [Position.character](#Position.character).
1468
+ # *
1469
+ # * @param position A position.
1470
+ # * @return A valid zero-based offset.
1471
+ # */
1472
+ # offsetAt(position: Position): number;
1473
+ # /**
1474
+ # * The number of lines in this document.
1475
+ # *
1476
+ # * @readonly
1477
+ # */
1478
+ # readonly lineCount: number;
1479
+ # }
1480
+ class TextDocument < LSPBase
1481
+ attr_accessor :uri, :languageId, :version, :lineCount # type: DocumentUri # type: string # type: number # type: number
1482
+
1483
+ def from_h!(value)
1484
+ value = {} if value.nil?
1485
+ self.uri = value['uri'] # Unknown type
1486
+ self.languageId = value['languageId']
1487
+ self.version = value['version']
1488
+ self.lineCount = value['lineCount']
1489
+ self
1490
+ end
1491
+ end
1492
+
1493
+ # export interface TextDocumentChangeEvent {
1494
+ # /**
1495
+ # * The document that has changed.
1496
+ # */
1497
+ # document: TextDocument;
1498
+ # }
1499
+ class TextDocumentChangeEvent < LSPBase
1500
+ attr_accessor :document # type: TextDocument
1501
+
1502
+ def from_h!(value)
1503
+ value = {} if value.nil?
1504
+ self.document = TextDocument.new(value['document']) unless value['document'].nil?
1505
+ self
1506
+ end
1507
+ end
1508
+
1509
+ # export interface TextDocumentWillSaveEvent {
1510
+ # /**
1511
+ # * The document that will be saved
1512
+ # */
1513
+ # document: TextDocument;
1514
+ # /**
1515
+ # * The reason why save was triggered.
1516
+ # */
1517
+ # reason: 1 | 2 | 3;
1518
+ # }
1519
+ class TextDocumentWillSaveEvent < LSPBase
1520
+ attr_accessor :document, :reason # type: TextDocument # type: 1 | 2 | 3
1521
+
1522
+ def from_h!(value)
1523
+ value = {} if value.nil?
1524
+ self.document = TextDocument.new(value['document']) unless value['document'].nil?
1525
+ self.reason = value['reason'] # Unknown type
1526
+ self
1527
+ end
1528
+ end
1529
+ end
1530
+
1531
+ # rubocop:enable Layout/EmptyLinesAroundClassBody
1532
+ # rubocop:enable Lint/UselessAssignment
1533
+ # rubocop:enable Style/AsciiComments
1534
+ # rubocop:enable Naming/MethodName