language_server-protocol 3.15.0.2 → 3.16.0.0

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 (153) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/language_server/protocol/constant.rb +10 -0
  4. data/lib/language_server/protocol/constant/code_action_kind.rb +6 -4
  5. data/lib/language_server/protocol/constant/completion_item_tag.rb +2 -2
  6. data/lib/language_server/protocol/constant/completion_trigger_kind.rb +2 -1
  7. data/lib/language_server/protocol/constant/diagnostic_tag.rb +2 -2
  8. data/lib/language_server/protocol/constant/error_codes.rb +26 -3
  9. data/lib/language_server/protocol/constant/failure_handling_kind.rb +6 -5
  10. data/lib/language_server/protocol/constant/file_operation_pattern_kind.rb +20 -0
  11. data/lib/language_server/protocol/constant/initialize_error.rb +2 -1
  12. data/lib/language_server/protocol/constant/insert_text_mode.rb +30 -0
  13. data/lib/language_server/protocol/constant/prepare_support_default_behavior.rb +13 -0
  14. data/lib/language_server/protocol/constant/signature_help_trigger_kind.rb +2 -1
  15. data/lib/language_server/protocol/constant/symbol_tag.rb +15 -0
  16. data/lib/language_server/protocol/constant/text_document_save_reason.rb +2 -2
  17. data/lib/language_server/protocol/constant/text_document_sync_kind.rb +2 -2
  18. data/lib/language_server/protocol/constant/token_format.rb +9 -0
  19. data/lib/language_server/protocol/interface.rb +112 -0
  20. data/lib/language_server/protocol/interface/annotated_text_edit.rb +38 -0
  21. data/lib/language_server/protocol/interface/apply_workspace_edit_response.rb +15 -4
  22. data/lib/language_server/protocol/interface/call_hierarchy_client_capabilities.rb +36 -0
  23. data/lib/language_server/protocol/interface/call_hierarchy_incoming_call.rb +43 -0
  24. data/lib/language_server/protocol/interface/call_hierarchy_incoming_calls_params.rb +31 -0
  25. data/lib/language_server/protocol/interface/call_hierarchy_item.rb +100 -0
  26. data/lib/language_server/protocol/interface/call_hierarchy_options.rb +25 -0
  27. data/lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb +43 -0
  28. data/lib/language_server/protocol/interface/call_hierarchy_outgoing_calls_params.rb +31 -0
  29. data/lib/language_server/protocol/interface/call_hierarchy_prepare_params.rb +25 -0
  30. data/lib/language_server/protocol/interface/call_hierarchy_registration_options.rb +25 -0
  31. data/lib/language_server/protocol/interface/change_annotation.rb +57 -0
  32. data/lib/language_server/protocol/interface/client_capabilities.rb +12 -3
  33. data/lib/language_server/protocol/interface/code_action.rb +43 -8
  34. data/lib/language_server/protocol/interface/code_action_client_capabilities.rb +44 -1
  35. data/lib/language_server/protocol/interface/code_action_context.rb +7 -6
  36. data/lib/language_server/protocol/interface/code_action_options.rb +13 -3
  37. data/lib/language_server/protocol/interface/code_action_registration_options.rb +2 -1
  38. data/lib/language_server/protocol/interface/code_description.rb +36 -0
  39. data/lib/language_server/protocol/interface/code_lens.rb +5 -3
  40. data/lib/language_server/protocol/interface/code_lens_workspace_client_capabilities.rb +39 -0
  41. data/lib/language_server/protocol/interface/color_presentation.rb +7 -6
  42. data/lib/language_server/protocol/interface/completion_client_capabilities.rb +1 -1
  43. data/lib/language_server/protocol/interface/completion_context.rb +5 -3
  44. data/lib/language_server/protocol/interface/completion_item.rb +60 -29
  45. data/lib/language_server/protocol/interface/completion_list.rb +2 -2
  46. data/lib/language_server/protocol/interface/completion_options.rb +15 -12
  47. data/lib/language_server/protocol/interface/completion_params.rb +2 -1
  48. data/lib/language_server/protocol/interface/create_file.rb +10 -1
  49. data/lib/language_server/protocol/interface/create_files_params.rb +37 -0
  50. data/lib/language_server/protocol/interface/declaration_client_capabilities.rb +3 -3
  51. data/lib/language_server/protocol/interface/delete_file.rb +10 -1
  52. data/lib/language_server/protocol/interface/delete_files_params.rb +37 -0
  53. data/lib/language_server/protocol/interface/diagnostic.rb +21 -1
  54. data/lib/language_server/protocol/interface/diagnostic_related_information.rb +3 -3
  55. data/lib/language_server/protocol/interface/did_change_text_document_params.rb +11 -9
  56. data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +3 -3
  57. data/lib/language_server/protocol/interface/document_filter.rb +7 -3
  58. data/lib/language_server/protocol/interface/document_highlight.rb +1 -1
  59. data/lib/language_server/protocol/interface/document_link.rb +6 -5
  60. data/lib/language_server/protocol/interface/document_symbol.rb +23 -11
  61. data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +24 -2
  62. data/lib/language_server/protocol/interface/document_symbol_options.rb +11 -1
  63. data/lib/language_server/protocol/interface/document_symbol_registration_options.rb +2 -1
  64. data/lib/language_server/protocol/interface/file_create.rb +36 -0
  65. data/lib/language_server/protocol/interface/file_delete.rb +36 -0
  66. data/lib/language_server/protocol/interface/file_operation_filter.rb +46 -0
  67. data/lib/language_server/protocol/interface/file_operation_pattern.rb +67 -0
  68. data/lib/language_server/protocol/interface/file_operation_pattern_options.rb +36 -0
  69. data/lib/language_server/protocol/interface/file_operation_registration_options.rb +36 -0
  70. data/lib/language_server/protocol/interface/file_rename.rb +45 -0
  71. data/lib/language_server/protocol/interface/file_system_watcher.rb +7 -3
  72. data/lib/language_server/protocol/interface/folding_range.rb +17 -8
  73. data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +10 -7
  74. data/lib/language_server/protocol/interface/hover.rb +1 -1
  75. data/lib/language_server/protocol/interface/hover_client_capabilities.rb +3 -2
  76. data/lib/language_server/protocol/interface/implementation_client_capabilities.rb +3 -3
  77. data/lib/language_server/protocol/interface/initialize_params.rb +20 -5
  78. data/lib/language_server/protocol/interface/insert_replace_edit.rb +54 -0
  79. data/lib/language_server/protocol/interface/linked_editing_range_client_capabilities.rb +36 -0
  80. data/lib/language_server/protocol/interface/linked_editing_range_options.rb +25 -0
  81. data/lib/language_server/protocol/interface/linked_editing_range_params.rb +25 -0
  82. data/lib/language_server/protocol/interface/linked_editing_range_registration_options.rb +25 -0
  83. data/lib/language_server/protocol/interface/linked_editing_ranges.rb +45 -0
  84. data/lib/language_server/protocol/interface/location_link.rb +9 -7
  85. data/lib/language_server/protocol/interface/log_message_params.rb +1 -1
  86. data/lib/language_server/protocol/interface/log_trace_params.rb +43 -0
  87. data/lib/language_server/protocol/interface/markdown_client_capabilities.rb +45 -0
  88. data/lib/language_server/protocol/interface/markup_content.rb +9 -7
  89. data/lib/language_server/protocol/interface/moniker.rb +64 -0
  90. data/lib/language_server/protocol/interface/moniker_client_capabilities.rb +36 -0
  91. data/lib/language_server/protocol/interface/moniker_options.rb +25 -0
  92. data/lib/language_server/protocol/interface/moniker_params.rb +25 -0
  93. data/lib/language_server/protocol/interface/moniker_registration_options.rb +25 -0
  94. data/lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb +42 -0
  95. data/lib/language_server/protocol/interface/parameter_information.rb +7 -5
  96. data/lib/language_server/protocol/interface/partial_result_params.rb +3 -3
  97. data/lib/language_server/protocol/interface/position.rb +5 -5
  98. data/lib/language_server/protocol/interface/progress_params.rb +1 -1
  99. data/lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb +21 -1
  100. data/lib/language_server/protocol/interface/publish_diagnostics_params.rb +2 -1
  101. data/lib/language_server/protocol/interface/regular_expressions_client_capabilities.rb +45 -0
  102. data/lib/language_server/protocol/interface/rename_client_capabilities.rb +27 -1
  103. data/lib/language_server/protocol/interface/rename_file.rb +10 -1
  104. data/lib/language_server/protocol/interface/rename_files_params.rb +38 -0
  105. data/lib/language_server/protocol/interface/selection_range.rb +2 -1
  106. data/lib/language_server/protocol/interface/selection_range_client_capabilities.rb +4 -3
  107. data/lib/language_server/protocol/interface/semantic_tokens.rb +45 -0
  108. data/lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb +97 -0
  109. data/lib/language_server/protocol/interface/semantic_tokens_delta.rb +40 -0
  110. data/lib/language_server/protocol/interface/semantic_tokens_delta_params.rb +44 -0
  111. data/lib/language_server/protocol/interface/semantic_tokens_delta_partial_result.rb +30 -0
  112. data/lib/language_server/protocol/interface/semantic_tokens_edit.rb +51 -0
  113. data/lib/language_server/protocol/interface/semantic_tokens_legend.rb +42 -0
  114. data/lib/language_server/protocol/interface/semantic_tokens_options.rb +53 -0
  115. data/lib/language_server/protocol/interface/semantic_tokens_params.rb +34 -0
  116. data/lib/language_server/protocol/interface/semantic_tokens_partial_result.rb +30 -0
  117. data/lib/language_server/protocol/interface/semantic_tokens_range_params.rb +43 -0
  118. data/lib/language_server/protocol/interface/semantic_tokens_registration_options.rb +25 -0
  119. data/lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb +39 -0
  120. data/lib/language_server/protocol/interface/server_capabilities.rb +47 -9
  121. data/lib/language_server/protocol/interface/set_trace_params.rb +33 -0
  122. data/lib/language_server/protocol/interface/show_document_client_capabilities.rb +37 -0
  123. data/lib/language_server/protocol/interface/show_document_params.rb +71 -0
  124. data/lib/language_server/protocol/interface/show_document_result.rb +36 -0
  125. data/lib/language_server/protocol/interface/show_message_params.rb +1 -1
  126. data/lib/language_server/protocol/interface/show_message_request_client_capabilities.rb +36 -0
  127. data/lib/language_server/protocol/interface/show_message_request_params.rb +1 -1
  128. data/lib/language_server/protocol/interface/signature_help.rb +3 -3
  129. data/lib/language_server/protocol/interface/signature_help_client_capabilities.rb +1 -1
  130. data/lib/language_server/protocol/interface/signature_help_context.rb +10 -7
  131. data/lib/language_server/protocol/interface/signature_help_options.rb +3 -2
  132. data/lib/language_server/protocol/interface/signature_help_params.rb +3 -2
  133. data/lib/language_server/protocol/interface/signature_information.rb +12 -1
  134. data/lib/language_server/protocol/interface/symbol_information.rb +10 -1
  135. data/lib/language_server/protocol/interface/text_document_change_registration_options.rb +1 -1
  136. data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +39 -2
  137. data/lib/language_server/protocol/interface/text_document_content_change_event.rb +2 -2
  138. data/lib/language_server/protocol/interface/text_document_edit.rb +2 -2
  139. data/lib/language_server/protocol/interface/text_document_registration_options.rb +3 -3
  140. data/lib/language_server/protocol/interface/text_document_sync_options.rb +13 -15
  141. data/lib/language_server/protocol/interface/type_definition_client_capabilities.rb +3 -3
  142. data/lib/language_server/protocol/interface/versioned_text_document_identifier.rb +3 -7
  143. data/lib/language_server/protocol/interface/will_save_text_document_params.rb +1 -1
  144. data/lib/language_server/protocol/interface/work_done_progress_begin.rb +3 -3
  145. data/lib/language_server/protocol/interface/work_done_progress_cancel_params.rb +1 -1
  146. data/lib/language_server/protocol/interface/work_done_progress_create_params.rb +1 -1
  147. data/lib/language_server/protocol/interface/work_done_progress_params.rb +1 -1
  148. data/lib/language_server/protocol/interface/work_done_progress_report.rb +5 -5
  149. data/lib/language_server/protocol/interface/workspace_edit.rb +24 -7
  150. data/lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb +23 -1
  151. data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +13 -2
  152. data/lib/language_server/protocol/version.rb +1 -1
  153. metadata +67 -6
@@ -25,7 +25,7 @@ module LanguageServer
25
25
  # The client supports the following `CompletionItem` specific
26
26
  # capabilities.
27
27
  #
28
- # @return [{ snippetSupport?: boolean; commitCharactersSupport?: boolean; documentationFormat?: MarkupKind[]...]
28
+ # @return [{ snippetSupport?: boolean; commitCharactersSupport?: boolean; documentationFormat?: MarkupKind[]; deprecatedSupport?: boolean; preselectSupport?: boolean; tagSupport?: { valueSet: 1[]; }; insertReplaceSupport?: boolean; resolveSupport?: { ...; }; insertTextModeSupport?: { ...; }; }]
29
29
  def completion_item
30
30
  attributes.fetch(:completionItem)
31
31
  end
@@ -2,7 +2,8 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  #
5
- # Contains additional information about the context in which a completion request is triggered.
5
+ # Contains additional information about the context in which a completion
6
+ # request is triggered.
6
7
  #
7
8
  class CompletionContext
8
9
  def initialize(trigger_kind:, trigger_character: nil)
@@ -23,8 +24,9 @@ module LanguageServer
23
24
  end
24
25
 
25
26
  #
26
- # The trigger character (a single character) that has trigger code complete.
27
- # Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`
27
+ # The trigger character (a single character) that has trigger code
28
+ # complete. Is undefined if
29
+ # `triggerKind !== CompletionTriggerKind.TriggerCharacter`
28
30
  #
29
31
  # @return [string]
30
32
  def trigger_character
@@ -2,7 +2,7 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class CompletionItem
5
- def initialize(label:, kind: nil, tags: nil, detail: nil, documentation: nil, deprecated: nil, preselect: nil, sort_text: nil, filter_text: nil, insert_text: nil, insert_text_format: nil, text_edit: nil, additional_text_edits: nil, commit_characters: nil, command: nil, data: nil)
5
+ def initialize(label:, kind: nil, tags: nil, detail: nil, documentation: nil, deprecated: nil, preselect: nil, sort_text: nil, filter_text: nil, insert_text: nil, insert_text_format: nil, insert_text_mode: nil, text_edit: nil, additional_text_edits: nil, commit_characters: nil, command: nil, data: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:label] = label
@@ -16,6 +16,7 @@ module LanguageServer
16
16
  @attributes[:filterText] = filter_text if filter_text
17
17
  @attributes[:insertText] = insert_text if insert_text
18
18
  @attributes[:insertTextFormat] = insert_text_format if insert_text_format
19
+ @attributes[:insertTextMode] = insert_text_mode if insert_text_mode
19
20
  @attributes[:textEdit] = text_edit if text_edit
20
21
  @attributes[:additionalTextEdits] = additional_text_edits if additional_text_edits
21
22
  @attributes[:commitCharacters] = commit_characters if commit_characters
@@ -40,7 +41,7 @@ module LanguageServer
40
41
  # an icon is chosen by the editor. The standardized set
41
42
  # of available values is defined in `CompletionItemKind`.
42
43
  #
43
- # @return [number]
44
+ # @return [any]
44
45
  def kind
45
46
  attributes.fetch(:kind)
46
47
  end
@@ -92,7 +93,8 @@ module LanguageServer
92
93
 
93
94
  #
94
95
  # A string that should be used when comparing this item
95
- # with other items. When `falsy` the label is used.
96
+ # with other items. When `falsy` the label is used
97
+ # as the sort text for this item.
96
98
  #
97
99
  # @return [string]
98
100
  def sort_text
@@ -101,7 +103,8 @@ module LanguageServer
101
103
 
102
104
  #
103
105
  # A string that should be used when filtering a set of
104
- # completion items. When `falsy` the label is used.
106
+ # completion items. When `falsy` the label is used as the
107
+ # filter text for this item.
105
108
  #
106
109
  # @return [string]
107
110
  def filter_text
@@ -110,14 +113,16 @@ module LanguageServer
110
113
 
111
114
  #
112
115
  # A string that should be inserted into a document when selecting
113
- # this completion. When `falsy` the label is used.
116
+ # this completion. When `falsy` the label is used as the insert text
117
+ # for this item.
114
118
  #
115
119
  # The `insertText` is subject to interpretation by the client side.
116
120
  # Some tools might not take the string literally. For example
117
- # VS Code when code complete is requested in this example `con<cursor position>`
118
- # and a completion item with an `insertText` of `console` is provided it
119
- # will only insert `sole`. Therefore it is recommended to use `textEdit` instead
120
- # since it avoids additional client side interpretation.
121
+ # VS Code when code complete is requested in this example
122
+ # `con<cursor position>` and a completion item with an `insertText` of
123
+ # `console` is provided it will only insert `sole`. Therefore it is
124
+ # recommended to use `textEdit` instead since it avoids additional client
125
+ # side interpretation.
121
126
  #
122
127
  # @return [string]
123
128
  def insert_text
@@ -125,35 +130,60 @@ module LanguageServer
125
130
  end
126
131
 
127
132
  #
128
- # The format of the insert text. The format applies to both the `insertText` property
129
- # and the `newText` property of a provided `textEdit`. If omitted defaults to
130
- # `InsertTextFormat.PlainText`.
133
+ # The format of the insert text. The format applies to both the
134
+ # `insertText` property and the `newText` property of a provided
135
+ # `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.
131
136
  #
132
- # @return [DiagnosticTag]
137
+ # @return [InsertTextFormat]
133
138
  def insert_text_format
134
139
  attributes.fetch(:insertTextFormat)
135
140
  end
136
141
 
137
142
  #
138
- # An edit which is applied to a document when selecting this completion. When an edit is provided the value of
139
- # `insertText` is ignored.
143
+ # How whitespace and indentation is handled during completion
144
+ # item insertion. If not provided the client's default value depends on
145
+ # the `textDocument.completion.insertTextMode` client capability.
146
+ #
147
+ # @return [InsertTextMode]
148
+ def insert_text_mode
149
+ attributes.fetch(:insertTextMode)
150
+ end
151
+
152
+ #
153
+ # An edit which is applied to a document when selecting this completion.
154
+ # When an edit is provided the value of `insertText` is ignored.
155
+ #
156
+ # *Note:* The range of the edit must be a single line range and it must
157
+ # contain the position at which completion has been requested.
158
+ #
159
+ # Most editors support two different operations when accepting a completion
160
+ # item. One is to insert a completion text and the other is to replace an
161
+ # existing text with a completion text. Since this can usually not be
162
+ # predetermined by a server it can report both ranges. Clients need to
163
+ # signal support for `InsertReplaceEdits` via the
164
+ # `textDocument.completion.insertReplaceSupport` client capability
165
+ # property.
140
166
  #
141
- # *Note:* The range of the edit must be a single line range and it must contain the position at which completion
142
- # has been requested.
167
+ # *Note 1:* The text edit's range as well as both ranges from an insert
168
+ # replace edit must be a [single line] and they must contain the position
169
+ # at which completion has been requested.
170
+ # *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range
171
+ # must be a prefix of the edit's replace range, that means it must be
172
+ # contained and starting at the same position.
143
173
  #
144
- # @return [TextEdit]
174
+ # @return [TextEdit | InsertReplaceEdit]
145
175
  def text_edit
146
176
  attributes.fetch(:textEdit)
147
177
  end
148
178
 
149
179
  #
150
180
  # An optional array of additional text edits that are applied when
151
- # selecting this completion. Edits must not overlap (including the same insert position)
152
- # with the main edit nor with themselves.
181
+ # selecting this completion. Edits must not overlap (including the same
182
+ # insert position) with the main edit nor with themselves.
153
183
  #
154
- # Additional text edits should be used to change text unrelated to the current cursor position
155
- # (for example adding an import statement at the top of the file if the completion item will
156
- # insert an unqualified type).
184
+ # Additional text edits should be used to change text unrelated to the
185
+ # current cursor position (for example adding an import statement at the
186
+ # top of the file if the completion item will insert an unqualified type).
157
187
  #
158
188
  # @return [TextEdit[]]
159
189
  def additional_text_edits
@@ -161,9 +191,10 @@ module LanguageServer
161
191
  end
162
192
 
163
193
  #
164
- # An optional set of characters that when pressed while this completion is active will accept it first and
165
- # then type that character. *Note* that all commit characters should have `length=1` and that superfluous
166
- # characters will be ignored.
194
+ # An optional set of characters that when pressed while this completion is
195
+ # active will accept it first and then type that character. *Note* that all
196
+ # commit characters should have `length=1` and that superfluous characters
197
+ # will be ignored.
167
198
  #
168
199
  # @return [string[]]
169
200
  def commit_characters
@@ -171,9 +202,9 @@ module LanguageServer
171
202
  end
172
203
 
173
204
  #
174
- # An optional command that is executed *after* inserting this completion. *Note* that
175
- # additional modifications to the current document should be described with the
176
- # additionalTextEdits-property.
205
+ # An optional command that is executed *after* inserting this completion.
206
+ # *Note* that additional modifications to the current document should be
207
+ # described with the additionalTextEdits-property.
177
208
  #
178
209
  # @return [Command]
179
210
  def command
@@ -2,8 +2,8 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  #
5
- # Represents a collection of [completion items](#CompletionItem) to be presented
6
- # in the editor.
5
+ # Represents a collection of [completion items](#CompletionItem) to be
6
+ # presented in the editor.
7
7
  #
8
8
  class CompletionList
9
9
  def initialize(is_incomplete:, items:)
@@ -17,14 +17,16 @@ module LanguageServer
17
17
  end
18
18
 
19
19
  #
20
- # Most tools trigger completion request automatically without explicitly requesting
21
- # it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user
22
- # starts to type an identifier. For example if the user types `c` in a JavaScript file
23
- # code complete will automatically pop up present `console` besides others as a
24
- # completion item. Characters that make up identifiers don't need to be listed here.
20
+ # Most tools trigger completion request automatically without explicitly
21
+ # requesting it using a keyboard shortcut (e.g. Ctrl+Space). Typically they
22
+ # do so when the user starts to type an identifier. For example if the user
23
+ # types `c` in a JavaScript file code complete will automatically pop up
24
+ # present `console` besides others as a completion item. Characters that
25
+ # make up identifiers don't need to be listed here.
25
26
  #
26
- # If code complete should automatically be trigger on characters not being valid inside
27
- # an identifier (for example `.` in JavaScript) list them in `triggerCharacters`.
27
+ # If code complete should automatically be trigger on characters not being
28
+ # valid inside an identifier (for example `.` in JavaScript) list them in
29
+ # `triggerCharacters`.
28
30
  #
29
31
  # @return [string[]]
30
32
  def trigger_characters
@@ -32,12 +34,13 @@ module LanguageServer
32
34
  end
33
35
 
34
36
  #
35
- # The list of all possible characters that commit a completion. This field can be used
36
- # if clients don't support individual commit characters per completion item. See
37
- # `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`.
37
+ # The list of all possible characters that commit a completion. This field
38
+ # can be used if clients don't support individual commit characters per
39
+ # completion item. See client capability
40
+ # `completion.completionItem.commitCharactersSupport`.
38
41
  #
39
- # If a server provides both `allCommitCharacters` and commit characters on an individual
40
- # completion item the ones on the completion item win.
42
+ # If a server provides both `allCommitCharacters` and commit characters on
43
+ # an individual completion item the ones on the completion item win.
41
44
  #
42
45
  # @return [string[]]
43
46
  def all_commit_characters
@@ -13,7 +13,8 @@ module LanguageServer
13
13
 
14
14
  #
15
15
  # The completion context. This is only available if the client specifies
16
- # to send this using `ClientCapabilities.textDocument.completion.contextSupport === true`
16
+ # to send this using the client capability
17
+ # `completion.contextSupport === true`
17
18
  #
18
19
  # @return [CompletionContext]
19
20
  def context
@@ -5,12 +5,13 @@ module LanguageServer
5
5
  # Create file operation
6
6
  #
7
7
  class CreateFile
8
- def initialize(kind:, uri:, options: nil)
8
+ def initialize(kind:, uri:, options: nil, annotation_id: nil)
9
9
  @attributes = {}
10
10
 
11
11
  @attributes[:kind] = kind
12
12
  @attributes[:uri] = uri
13
13
  @attributes[:options] = options if options
14
+ @attributes[:annotationId] = annotation_id if annotation_id
14
15
 
15
16
  @attributes.freeze
16
17
  end
@@ -39,6 +40,14 @@ module LanguageServer
39
40
  attributes.fetch(:options)
40
41
  end
41
42
 
43
+ #
44
+ # An optional annotation identifer describing the operation.
45
+ #
46
+ # @return [string]
47
+ def annotation_id
48
+ attributes.fetch(:annotationId)
49
+ end
50
+
42
51
  attr_reader :attributes
43
52
 
44
53
  def to_hash
@@ -0,0 +1,37 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # The parameters sent in notifications/requests for user-initiated creation
6
+ # of files.
7
+ #
8
+ class CreateFilesParams
9
+ def initialize(files:)
10
+ @attributes = {}
11
+
12
+ @attributes[:files] = files
13
+
14
+ @attributes.freeze
15
+ end
16
+
17
+ #
18
+ # An array of all files/folders created in this operation.
19
+ #
20
+ # @return [FileCreate[]]
21
+ def files
22
+ attributes.fetch(:files)
23
+ end
24
+
25
+ attr_reader :attributes
26
+
27
+ def to_hash
28
+ attributes
29
+ end
30
+
31
+ def to_json(*args)
32
+ to_hash.to_json(*args)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -12,9 +12,9 @@ module LanguageServer
12
12
  end
13
13
 
14
14
  #
15
- # Whether declaration supports dynamic registration. If this is set to `true`
16
- # the client supports the new `DeclarationRegistrationOptions` return value
17
- # for the corresponding server capability as well.
15
+ # Whether declaration supports dynamic registration. If this is set to
16
+ # `true` the client supports the new `DeclarationRegistrationOptions`
17
+ # return value for the corresponding server capability as well.
18
18
  #
19
19
  # @return [boolean]
20
20
  def dynamic_registration
@@ -5,12 +5,13 @@ module LanguageServer
5
5
  # Delete file operation
6
6
  #
7
7
  class DeleteFile
8
- def initialize(kind:, uri:, options: nil)
8
+ def initialize(kind:, uri:, options: nil, annotation_id: nil)
9
9
  @attributes = {}
10
10
 
11
11
  @attributes[:kind] = kind
12
12
  @attributes[:uri] = uri
13
13
  @attributes[:options] = options if options
14
+ @attributes[:annotationId] = annotation_id if annotation_id
14
15
 
15
16
  @attributes.freeze
16
17
  end
@@ -39,6 +40,14 @@ module LanguageServer
39
40
  attributes.fetch(:options)
40
41
  end
41
42
 
43
+ #
44
+ # An optional annotation identifer describing the operation.
45
+ #
46
+ # @return [string]
47
+ def annotation_id
48
+ attributes.fetch(:annotationId)
49
+ end
50
+
42
51
  attr_reader :attributes
43
52
 
44
53
  def to_hash
@@ -0,0 +1,37 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # The parameters sent in notifications/requests for user-initiated deletes
6
+ # of files.
7
+ #
8
+ class DeleteFilesParams
9
+ def initialize(files:)
10
+ @attributes = {}
11
+
12
+ @attributes[:files] = files
13
+
14
+ @attributes.freeze
15
+ end
16
+
17
+ #
18
+ # An array of all files/folders deleted in this operation.
19
+ #
20
+ # @return [FileDelete[]]
21
+ def files
22
+ attributes.fetch(:files)
23
+ end
24
+
25
+ attr_reader :attributes
26
+
27
+ def to_hash
28
+ attributes
29
+ end
30
+
31
+ def to_json(*args)
32
+ to_hash.to_json(*args)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -2,16 +2,18 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class Diagnostic
5
- def initialize(range:, severity: nil, code: nil, source: nil, message:, tags: nil, related_information: nil)
5
+ def initialize(range:, severity: nil, code: nil, code_description: nil, source: nil, message:, tags: nil, related_information: nil, data: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:range] = range
9
9
  @attributes[:severity] = severity if severity
10
10
  @attributes[:code] = code if code
11
+ @attributes[:codeDescription] = code_description if code_description
11
12
  @attributes[:source] = source if source
12
13
  @attributes[:message] = message
13
14
  @attributes[:tags] = tags if tags
14
15
  @attributes[:relatedInformation] = related_information if related_information
16
+ @attributes[:data] = data if data
15
17
 
16
18
  @attributes.freeze
17
19
  end
@@ -41,6 +43,14 @@ module LanguageServer
41
43
  attributes.fetch(:code)
42
44
  end
43
45
 
46
+ #
47
+ # An optional property to describe the error code.
48
+ #
49
+ # @return [CodeDescription]
50
+ def code_description
51
+ attributes.fetch(:codeDescription)
52
+ end
53
+
44
54
  #
45
55
  # A human-readable string describing the source of this
46
56
  # diagnostic, e.g. 'typescript' or 'super lint'.
@@ -75,6 +85,16 @@ module LanguageServer
75
85
  attributes.fetch(:relatedInformation)
76
86
  end
77
87
 
88
+ #
89
+ # A data entry field that is preserved between a
90
+ # `textDocument/publishDiagnostics` notification and
91
+ # `textDocument/codeAction` request.
92
+ #
93
+ # @return [unknown]
94
+ def data
95
+ attributes.fetch(:data)
96
+ end
97
+
78
98
  attr_reader :attributes
79
99
 
80
100
  def to_hash