language_server-protocol 3.16.0.2 → 3.17.0.1

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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/lib/language_server/protocol/constant/code_action_kind.rb +8 -0
  3. data/lib/language_server/protocol/constant/code_action_trigger_kind.rb +22 -0
  4. data/lib/language_server/protocol/constant/document_diagnostic_report_kind.rb +21 -0
  5. data/lib/language_server/protocol/constant/error_codes.rb +33 -2
  6. data/lib/language_server/protocol/constant/folding_range_kind.rb +24 -0
  7. data/lib/language_server/protocol/constant/{initialize_error.rb → initialize_error_codes.rb} +4 -4
  8. data/lib/language_server/protocol/constant/inlay_hint_kind.rb +19 -0
  9. data/lib/language_server/protocol/constant/moniker_kind.rb +24 -0
  10. data/lib/language_server/protocol/constant/notebook_cell_kind.rb +19 -0
  11. data/lib/language_server/protocol/constant/position_encoding_kind.rb +32 -0
  12. data/lib/language_server/protocol/constant/prepare_support_default_behavior.rb +1 -1
  13. data/lib/language_server/protocol/constant/semantic_token_modifiers.rb +18 -0
  14. data/lib/language_server/protocol/constant/semantic_token_types.rb +35 -0
  15. data/lib/language_server/protocol/constant/uniqueness_level.rb +31 -0
  16. data/lib/language_server/protocol/constant.rb +22 -2
  17. data/lib/language_server/protocol/interface/{apply_workspace_edit_response.rb → apply_workspace_edit_result.rb} +2 -2
  18. data/lib/language_server/protocol/interface/call_hierarchy_item.rb +1 -1
  19. data/lib/language_server/protocol/interface/client_capabilities.rb +13 -4
  20. data/lib/language_server/protocol/interface/code_action.rb +1 -1
  21. data/lib/language_server/protocol/interface/code_action_context.rb +10 -1
  22. data/lib/language_server/protocol/interface/code_lens.rb +1 -1
  23. data/lib/language_server/protocol/interface/color_presentation.rb +1 -1
  24. data/lib/language_server/protocol/interface/command.rb +1 -1
  25. data/lib/language_server/protocol/interface/completion_client_capabilities.rb +23 -3
  26. data/lib/language_server/protocol/interface/completion_item.rb +41 -9
  27. data/lib/language_server/protocol/interface/completion_item_label_details.rb +49 -0
  28. data/lib/language_server/protocol/interface/completion_list.rb +24 -2
  29. data/lib/language_server/protocol/interface/completion_options.rb +11 -1
  30. data/lib/language_server/protocol/interface/completion_registration_options.rb +11 -1
  31. data/lib/language_server/protocol/interface/create_file.rb +1 -1
  32. data/lib/language_server/protocol/interface/delete_file.rb +1 -1
  33. data/lib/language_server/protocol/interface/diagnostic_client_capabilities.rb +49 -0
  34. data/lib/language_server/protocol/interface/diagnostic_options.rb +64 -0
  35. data/lib/language_server/protocol/interface/diagnostic_registration_options.rb +84 -0
  36. data/lib/language_server/protocol/interface/diagnostic_server_cancellation_data.rb +33 -0
  37. data/lib/language_server/protocol/interface/diagnostic_workspace_client_capabilities.rb +42 -0
  38. data/lib/language_server/protocol/interface/did_change_configuration_params.rb +1 -1
  39. data/lib/language_server/protocol/interface/did_change_notebook_document_params.rb +56 -0
  40. data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +11 -1
  41. data/lib/language_server/protocol/interface/did_close_notebook_document_params.rb +46 -0
  42. data/lib/language_server/protocol/interface/did_open_notebook_document_params.rb +46 -0
  43. data/lib/language_server/protocol/interface/did_save_notebook_document_params.rb +36 -0
  44. data/lib/language_server/protocol/interface/document_diagnostic_params.rb +73 -0
  45. data/lib/language_server/protocol/interface/document_diagnostic_report_partial_result.rb +33 -0
  46. data/lib/language_server/protocol/interface/document_link.rb +1 -1
  47. data/lib/language_server/protocol/interface/document_on_type_formatting_options.rb +1 -1
  48. data/lib/language_server/protocol/interface/document_on_type_formatting_params.rb +9 -4
  49. data/lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb +1 -1
  50. data/lib/language_server/protocol/interface/document_symbol.rb +1 -1
  51. data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +1 -1
  52. data/lib/language_server/protocol/interface/execute_command_params.rb +1 -1
  53. data/lib/language_server/protocol/interface/execution_summary.rb +45 -0
  54. data/lib/language_server/protocol/interface/file_system_watcher.rb +3 -14
  55. data/lib/language_server/protocol/interface/folding_range.rb +12 -1
  56. data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +19 -1
  57. data/lib/language_server/protocol/interface/full_document_diagnostic_report.rb +56 -0
  58. data/lib/language_server/protocol/interface/hover_client_capabilities.rb +1 -1
  59. data/lib/language_server/protocol/interface/hover_result.rb +30 -0
  60. data/lib/language_server/protocol/interface/initialize_error.rb +0 -3
  61. data/lib/language_server/protocol/interface/initialize_params.rb +1 -1
  62. data/lib/language_server/protocol/interface/inlay_hint.rb +122 -0
  63. data/lib/language_server/protocol/interface/inlay_hint_client_capabilities.rb +46 -0
  64. data/lib/language_server/protocol/interface/inlay_hint_label_part.rb +79 -0
  65. data/lib/language_server/protocol/interface/inlay_hint_options.rb +43 -0
  66. data/lib/language_server/protocol/interface/inlay_hint_params.rb +54 -0
  67. data/lib/language_server/protocol/interface/inlay_hint_registration_options.rb +63 -0
  68. data/lib/language_server/protocol/interface/inlay_hint_workspace_client_capabilities.rb +42 -0
  69. data/lib/language_server/protocol/interface/inline_value_client_capabilities.rb +37 -0
  70. data/lib/language_server/protocol/interface/inline_value_context.rb +44 -0
  71. data/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb +52 -0
  72. data/lib/language_server/protocol/interface/inline_value_options.rb +33 -0
  73. data/lib/language_server/protocol/interface/inline_value_params.rb +64 -0
  74. data/lib/language_server/protocol/interface/inline_value_registration_options.rb +53 -0
  75. data/lib/language_server/protocol/interface/inline_value_text.rb +45 -0
  76. data/lib/language_server/protocol/interface/inline_value_variable_lookup.rb +61 -0
  77. data/lib/language_server/protocol/interface/inline_value_workspace_client_capabilities.rb +42 -0
  78. data/lib/language_server/protocol/interface/linked_editing_ranges.rb +5 -4
  79. data/lib/language_server/protocol/interface/location_link.rb +1 -1
  80. data/lib/language_server/protocol/interface/notebook_cell.rb +69 -0
  81. data/lib/language_server/protocol/interface/notebook_cell_array_change.rb +55 -0
  82. data/lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb +52 -0
  83. data/lib/language_server/protocol/interface/notebook_document.rb +74 -0
  84. data/lib/language_server/protocol/interface/notebook_document_change_event.rb +45 -0
  85. data/lib/language_server/protocol/interface/notebook_document_client_capabilities.rb +36 -0
  86. data/lib/language_server/protocol/interface/notebook_document_filter.rb +79 -0
  87. data/lib/language_server/protocol/interface/notebook_document_identifier.rb +36 -0
  88. data/lib/language_server/protocol/interface/notebook_document_sync_client_capabilities.rb +48 -0
  89. data/lib/language_server/protocol/interface/notebook_document_sync_options.rb +56 -0
  90. data/lib/language_server/protocol/interface/notebook_document_sync_registration_options.rb +56 -0
  91. data/lib/language_server/protocol/interface/position.rb +2 -3
  92. data/lib/language_server/protocol/interface/prepare_rename_params.rb +10 -1
  93. data/lib/language_server/protocol/interface/previous_result_id.rb +46 -0
  94. data/lib/language_server/protocol/interface/registration.rb +1 -1
  95. data/lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb +69 -0
  96. data/lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb +62 -0
  97. data/lib/language_server/protocol/interface/relative_pattern.rb +48 -0
  98. data/lib/language_server/protocol/interface/rename_client_capabilities.rb +1 -1
  99. data/lib/language_server/protocol/interface/rename_file.rb +1 -1
  100. data/lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb +29 -1
  101. data/lib/language_server/protocol/interface/server_capabilities.rb +62 -2
  102. data/lib/language_server/protocol/interface/signature_help.rb +2 -2
  103. data/lib/language_server/protocol/interface/symbol_information.rb +1 -1
  104. data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +37 -1
  105. data/lib/language_server/protocol/interface/text_document_content_change_event.rb +2 -2
  106. data/lib/language_server/protocol/interface/text_document_sync_options.rb +2 -0
  107. data/lib/language_server/protocol/interface/type_hierarchy_item.rb +102 -0
  108. data/lib/language_server/protocol/interface/type_hierarchy_options.rb +30 -0
  109. data/lib/language_server/protocol/interface/type_hierarchy_prepare_params.rb +51 -0
  110. data/lib/language_server/protocol/interface/type_hierarchy_registration_options.rb +50 -0
  111. data/lib/language_server/protocol/interface/type_hierarchy_subtypes_params.rb +49 -0
  112. data/lib/language_server/protocol/interface/type_hierarchy_supertypes_params.rb +49 -0
  113. data/lib/language_server/protocol/interface/unchanged_document_diagnostic_report.rb +50 -0
  114. data/lib/language_server/protocol/interface/{markdown_client_capabilities.rb → versioned_notebook_document_identifier.rb} +12 -12
  115. data/lib/language_server/protocol/interface/work_done_progress_report.rb +1 -1
  116. data/lib/language_server/protocol/interface/workspace_diagnostic_params.rb +65 -0
  117. data/lib/language_server/protocol/interface/workspace_diagnostic_report.rb +33 -0
  118. data/lib/language_server/protocol/interface/workspace_diagnostic_report_partial_result.rb +33 -0
  119. data/lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb +75 -0
  120. data/lib/language_server/protocol/interface/workspace_symbol.rb +89 -0
  121. data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +14 -3
  122. data/lib/language_server/protocol/interface/workspace_symbol_options.rb +11 -1
  123. data/lib/language_server/protocol/interface/workspace_symbol_registration_options.rb +11 -1
  124. data/lib/language_server/protocol/interface/workspace_unchanged_document_diagnostic_report.rb +68 -0
  125. data/lib/language_server/protocol/interface.rb +124 -4
  126. data/lib/language_server/protocol/transport/io/reader.rb +7 -24
  127. data/lib/language_server/protocol/version.rb +1 -1
  128. metadata +75 -20
@@ -2,13 +2,15 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class CompletionClientCapabilities
5
- def initialize(dynamic_registration: nil, completion_item: nil, completion_item_kind: nil, context_support: nil)
5
+ def initialize(dynamic_registration: nil, completion_item: nil, completion_item_kind: nil, context_support: nil, insert_text_mode: nil, completion_list: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
9
9
  @attributes[:completionItem] = completion_item if completion_item
10
10
  @attributes[:completionItemKind] = completion_item_kind if completion_item_kind
11
11
  @attributes[:contextSupport] = context_support if context_support
12
+ @attributes[:insertTextMode] = insert_text_mode if insert_text_mode
13
+ @attributes[:completionList] = completion_list if completion_list
12
14
 
13
15
  @attributes.freeze
14
16
  end
@@ -25,12 +27,12 @@ module LanguageServer
25
27
  # The client supports the following `CompletionItem` specific
26
28
  # capabilities.
27
29
  #
28
- # @return [{ snippetSupport?: boolean; commitCharactersSupport?: boolean; documentationFormat?: MarkupKind[]; deprecatedSupport?: boolean; preselectSupport?: boolean; tagSupport?: { valueSet: 1[]; }; insertReplaceSupport?: boolean; resolveSupport?: { ...; }; insertTextModeSupport?: { ...; }; }]
30
+ # @return [{ snippetSupport?: boolean; commitCharactersSupport?: boolean; documentationFormat?: MarkupKind[]; deprecatedSupport?: boolean; preselectSupport?: boolean; tagSupport?: { valueSet: 1[]; }; insertReplaceSupport?: boolean; resolveSupport?: { ...; }; insertTextModeSupport?: { ...; }; labelDetailsSupport?: boolean; }]
29
31
  def completion_item
30
32
  attributes.fetch(:completionItem)
31
33
  end
32
34
 
33
- # @return [{ valueSet?: any[]; }]
35
+ # @return [{ valueSet?: CompletionItemKind[]; }]
34
36
  def completion_item_kind
35
37
  attributes.fetch(:completionItemKind)
36
38
  end
@@ -44,6 +46,24 @@ module LanguageServer
44
46
  attributes.fetch(:contextSupport)
45
47
  end
46
48
 
49
+ #
50
+ # The client's default when the completion item doesn't provide a
51
+ # `insertTextMode` property.
52
+ #
53
+ # @return [InsertTextMode]
54
+ def insert_text_mode
55
+ attributes.fetch(:insertTextMode)
56
+ end
57
+
58
+ #
59
+ # The client supports the following `CompletionList` specific
60
+ # capabilities.
61
+ #
62
+ # @return [{ itemDefaults?: string[]; }]
63
+ def completion_list
64
+ attributes.fetch(:completionList)
65
+ end
66
+
47
67
  attr_reader :attributes
48
68
 
49
69
  def to_hash
@@ -2,10 +2,11 @@ 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, insert_text_mode: nil, text_edit: nil, additional_text_edits: nil, commit_characters: nil, command: nil, data: nil)
5
+ def initialize(label:, label_details: nil, 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, text_edit_text: nil, additional_text_edits: nil, commit_characters: nil, command: nil, data: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:label] = label
9
+ @attributes[:labelDetails] = label_details if label_details
9
10
  @attributes[:kind] = kind if kind
10
11
  @attributes[:tags] = tags if tags
11
12
  @attributes[:detail] = detail if detail
@@ -18,6 +19,7 @@ module LanguageServer
18
19
  @attributes[:insertTextFormat] = insert_text_format if insert_text_format
19
20
  @attributes[:insertTextMode] = insert_text_mode if insert_text_mode
20
21
  @attributes[:textEdit] = text_edit if text_edit
22
+ @attributes[:textEditText] = text_edit_text if text_edit_text
21
23
  @attributes[:additionalTextEdits] = additional_text_edits if additional_text_edits
22
24
  @attributes[:commitCharacters] = commit_characters if commit_characters
23
25
  @attributes[:command] = command if command
@@ -27,21 +29,33 @@ module LanguageServer
27
29
  end
28
30
 
29
31
  #
30
- # The label of this completion item. By default
31
- # also the text that is inserted when selecting
32
- # this completion.
32
+ # The label of this completion item.
33
+ #
34
+ # The label property is also by default the text that
35
+ # is inserted when selecting this completion.
36
+ #
37
+ # If label details are provided the label itself should
38
+ # be an unqualified name of the completion item.
33
39
  #
34
40
  # @return [string]
35
41
  def label
36
42
  attributes.fetch(:label)
37
43
  end
38
44
 
45
+ #
46
+ # Additional details for the label
47
+ #
48
+ # @return [CompletionItemLabelDetails]
49
+ def label_details
50
+ attributes.fetch(:labelDetails)
51
+ end
52
+
39
53
  #
40
54
  # The kind of this completion item. Based of the kind
41
55
  # an icon is chosen by the editor. The standardized set
42
56
  # of available values is defined in `CompletionItemKind`.
43
57
  #
44
- # @return [any]
58
+ # @return [CompletionItemKind]
45
59
  def kind
46
60
  attributes.fetch(:kind)
47
61
  end
@@ -134,6 +148,9 @@ module LanguageServer
134
148
  # `insertText` property and the `newText` property of a provided
135
149
  # `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.
136
150
  #
151
+ # Please note that the insertTextFormat doesn't apply to
152
+ # `additionalTextEdits`.
153
+ #
137
154
  # @return [InsertTextFormat]
138
155
  def insert_text_format
139
156
  attributes.fetch(:insertTextFormat)
@@ -160,9 +177,9 @@ module LanguageServer
160
177
  # item. One is to insert a completion text and the other is to replace an
161
178
  # existing text with a completion text. Since this can usually not be
162
179
  # 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.
180
+ # signal support for `InsertReplaceEdit`s via the
181
+ # `textDocument.completion.completionItem.insertReplaceSupport` client
182
+ # capability property.
166
183
  #
167
184
  # *Note 1:* The text edit's range as well as both ranges from an insert
168
185
  # replace edit must be a [single line] and they must contain the position
@@ -176,6 +193,21 @@ module LanguageServer
176
193
  attributes.fetch(:textEdit)
177
194
  end
178
195
 
196
+ #
197
+ # The edit text used if the completion item is part of a CompletionList and
198
+ # CompletionList defines an item default for the text edit range.
199
+ #
200
+ # Clients will only honor this property if they opt into completion list
201
+ # item defaults using the capability `completionList.itemDefaults`.
202
+ #
203
+ # If not provided and a list's default range is provided the label
204
+ # property is used as a text.
205
+ #
206
+ # @return [string]
207
+ def text_edit_text
208
+ attributes.fetch(:textEditText)
209
+ end
210
+
179
211
  #
180
212
  # An optional array of additional text edits that are applied when
181
213
  # selecting this completion. Edits must not overlap (including the same
@@ -215,7 +247,7 @@ module LanguageServer
215
247
  # A data entry field that is preserved on a completion item between
216
248
  # a completion and a completion resolve request.
217
249
  #
218
- # @return [any]
250
+ # @return [LSPAny]
219
251
  def data
220
252
  attributes.fetch(:data)
221
253
  end
@@ -0,0 +1,49 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Additional details for a completion item label.
6
+ #
7
+ class CompletionItemLabelDetails
8
+ def initialize(detail: nil, description: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:detail] = detail if detail
12
+ @attributes[:description] = description if description
13
+
14
+ @attributes.freeze
15
+ end
16
+
17
+ #
18
+ # An optional string which is rendered less prominently directly after
19
+ # {@link CompletionItem.label label}, without any spacing. Should be
20
+ # used for function signatures or type annotations.
21
+ #
22
+ # @return [string]
23
+ def detail
24
+ attributes.fetch(:detail)
25
+ end
26
+
27
+ #
28
+ # An optional string which is rendered less prominently after
29
+ # {@link CompletionItemLabelDetails.detail}. Should be used for fully qualified
30
+ # names or file path.
31
+ #
32
+ # @return [string]
33
+ def description
34
+ attributes.fetch(:description)
35
+ end
36
+
37
+ attr_reader :attributes
38
+
39
+ def to_hash
40
+ attributes
41
+ end
42
+
43
+ def to_json(*args)
44
+ to_hash.to_json(*args)
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -6,24 +6,46 @@ module LanguageServer
6
6
  # presented in the editor.
7
7
  #
8
8
  class CompletionList
9
- def initialize(is_incomplete:, items:)
9
+ def initialize(is_incomplete:, item_defaults: nil, items:)
10
10
  @attributes = {}
11
11
 
12
12
  @attributes[:isIncomplete] = is_incomplete
13
+ @attributes[:itemDefaults] = item_defaults if item_defaults
13
14
  @attributes[:items] = items
14
15
 
15
16
  @attributes.freeze
16
17
  end
17
18
 
18
19
  #
19
- # This list it not complete. Further typing should result in recomputing
20
+ # This list is not complete. Further typing should result in recomputing
20
21
  # this list.
21
22
  #
23
+ # Recomputed lists have all their items replaced (not appended) in the
24
+ # incomplete completion sessions.
25
+ #
22
26
  # @return [boolean]
23
27
  def is_incomplete
24
28
  attributes.fetch(:isIncomplete)
25
29
  end
26
30
 
31
+ #
32
+ # In many cases the items of an actual completion result share the same
33
+ # value for properties like `commitCharacters` or the range of a text
34
+ # edit. A completion list can therefore define item defaults which will
35
+ # be used if a completion item itself doesn't specify the value.
36
+ #
37
+ # If a completion list specifies a default value and a completion item
38
+ # also specifies a corresponding value the one from the item is used.
39
+ #
40
+ # Servers are only allowed to return default values if the client
41
+ # signals support for this via the `completionList.itemDefaults`
42
+ # capability.
43
+ #
44
+ # @return [{ commitCharacters?: string[]; editRange?: Range | { insert: Range; replace: Range; }; insertTextFormat?: InsertTextFormat; insertTextMode?: InsertTextMode; data?: LSPAny; }]
45
+ def item_defaults
46
+ attributes.fetch(:itemDefaults)
47
+ end
48
+
27
49
  #
28
50
  # The completion items.
29
51
  #
@@ -5,13 +5,14 @@ module LanguageServer
5
5
  # Completion options.
6
6
  #
7
7
  class CompletionOptions
8
- def initialize(work_done_progress: nil, trigger_characters: nil, all_commit_characters: nil, resolve_provider: nil)
8
+ def initialize(work_done_progress: nil, trigger_characters: nil, all_commit_characters: nil, resolve_provider: nil, completion_item: nil)
9
9
  @attributes = {}
10
10
 
11
11
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
12
12
  @attributes[:triggerCharacters] = trigger_characters if trigger_characters
13
13
  @attributes[:allCommitCharacters] = all_commit_characters if all_commit_characters
14
14
  @attributes[:resolveProvider] = resolve_provider if resolve_provider
15
+ @attributes[:completionItem] = completion_item if completion_item
15
16
 
16
17
  @attributes.freeze
17
18
  end
@@ -61,6 +62,15 @@ module LanguageServer
61
62
  attributes.fetch(:resolveProvider)
62
63
  end
63
64
 
65
+ #
66
+ # The server supports the following `CompletionItem` specific
67
+ # capabilities.
68
+ #
69
+ # @return [{ labelDetailsSupport?: boolean; }]
70
+ def completion_item
71
+ attributes.fetch(:completionItem)
72
+ end
73
+
64
74
  attr_reader :attributes
65
75
 
66
76
  def to_hash
@@ -2,7 +2,7 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class CompletionRegistrationOptions
5
- def initialize(document_selector:, work_done_progress: nil, trigger_characters: nil, all_commit_characters: nil, resolve_provider: nil)
5
+ def initialize(document_selector:, work_done_progress: nil, trigger_characters: nil, all_commit_characters: nil, resolve_provider: nil, completion_item: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:documentSelector] = document_selector
@@ -10,6 +10,7 @@ module LanguageServer
10
10
  @attributes[:triggerCharacters] = trigger_characters if trigger_characters
11
11
  @attributes[:allCommitCharacters] = all_commit_characters if all_commit_characters
12
12
  @attributes[:resolveProvider] = resolve_provider if resolve_provider
13
+ @attributes[:completionItem] = completion_item if completion_item
13
14
 
14
15
  @attributes.freeze
15
16
  end
@@ -68,6 +69,15 @@ module LanguageServer
68
69
  attributes.fetch(:resolveProvider)
69
70
  end
70
71
 
72
+ #
73
+ # The server supports the following `CompletionItem` specific
74
+ # capabilities.
75
+ #
76
+ # @return [{ labelDetailsSupport?: boolean; }]
77
+ def completion_item
78
+ attributes.fetch(:completionItem)
79
+ end
80
+
71
81
  attr_reader :attributes
72
82
 
73
83
  def to_hash
@@ -41,7 +41,7 @@ module LanguageServer
41
41
  end
42
42
 
43
43
  #
44
- # An optional annotation identifer describing the operation.
44
+ # An optional annotation identifier describing the operation.
45
45
  #
46
46
  # @return [string]
47
47
  def annotation_id
@@ -41,7 +41,7 @@ module LanguageServer
41
41
  end
42
42
 
43
43
  #
44
- # An optional annotation identifer describing the operation.
44
+ # An optional annotation identifier describing the operation.
45
45
  #
46
46
  # @return [string]
47
47
  def annotation_id
@@ -0,0 +1,49 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Client capabilities specific to diagnostic pull requests.
6
+ #
7
+ class DiagnosticClientCapabilities
8
+ def initialize(dynamic_registration: nil, related_document_support: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
12
+ @attributes[:relatedDocumentSupport] = related_document_support if related_document_support
13
+
14
+ @attributes.freeze
15
+ end
16
+
17
+ #
18
+ # Whether implementation supports dynamic registration. If this is set to
19
+ # `true` the client supports the new
20
+ # `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
21
+ # return value for the corresponding server capability as well.
22
+ #
23
+ # @return [boolean]
24
+ def dynamic_registration
25
+ attributes.fetch(:dynamicRegistration)
26
+ end
27
+
28
+ #
29
+ # Whether the clients supports related documents for document diagnostic
30
+ # pulls.
31
+ #
32
+ # @return [boolean]
33
+ def related_document_support
34
+ attributes.fetch(:relatedDocumentSupport)
35
+ end
36
+
37
+ attr_reader :attributes
38
+
39
+ def to_hash
40
+ attributes
41
+ end
42
+
43
+ def to_json(*args)
44
+ to_hash.to_json(*args)
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,64 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Diagnostic options.
6
+ #
7
+ class DiagnosticOptions
8
+ def initialize(work_done_progress: nil, identifier: nil, inter_file_dependencies:, workspace_diagnostics:)
9
+ @attributes = {}
10
+
11
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
12
+ @attributes[:identifier] = identifier if identifier
13
+ @attributes[:interFileDependencies] = inter_file_dependencies
14
+ @attributes[:workspaceDiagnostics] = workspace_diagnostics
15
+
16
+ @attributes.freeze
17
+ end
18
+
19
+ # @return [boolean]
20
+ def work_done_progress
21
+ attributes.fetch(:workDoneProgress)
22
+ end
23
+
24
+ #
25
+ # An optional identifier under which the diagnostics are
26
+ # managed by the client.
27
+ #
28
+ # @return [string]
29
+ def identifier
30
+ attributes.fetch(:identifier)
31
+ end
32
+
33
+ #
34
+ # Whether the language has inter file dependencies meaning that
35
+ # editing code in one file can result in a different diagnostic
36
+ # set in another file. Inter file dependencies are common for
37
+ # most programming languages and typically uncommon for linters.
38
+ #
39
+ # @return [boolean]
40
+ def inter_file_dependencies
41
+ attributes.fetch(:interFileDependencies)
42
+ end
43
+
44
+ #
45
+ # The server provides support for workspace diagnostics as well.
46
+ #
47
+ # @return [boolean]
48
+ def workspace_diagnostics
49
+ attributes.fetch(:workspaceDiagnostics)
50
+ end
51
+
52
+ attr_reader :attributes
53
+
54
+ def to_hash
55
+ attributes
56
+ end
57
+
58
+ def to_json(*args)
59
+ to_hash.to_json(*args)
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,84 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Diagnostic registration options.
6
+ #
7
+ class DiagnosticRegistrationOptions
8
+ def initialize(document_selector:, work_done_progress: nil, identifier: nil, inter_file_dependencies:, workspace_diagnostics:, id: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:documentSelector] = document_selector
12
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
13
+ @attributes[:identifier] = identifier if identifier
14
+ @attributes[:interFileDependencies] = inter_file_dependencies
15
+ @attributes[:workspaceDiagnostics] = workspace_diagnostics
16
+ @attributes[:id] = id if id
17
+
18
+ @attributes.freeze
19
+ end
20
+
21
+ #
22
+ # A document selector to identify the scope of the registration. If set to
23
+ # null the document selector provided on the client side will be used.
24
+ #
25
+ # @return [DocumentSelector]
26
+ def document_selector
27
+ attributes.fetch(:documentSelector)
28
+ end
29
+
30
+ # @return [boolean]
31
+ def work_done_progress
32
+ attributes.fetch(:workDoneProgress)
33
+ end
34
+
35
+ #
36
+ # An optional identifier under which the diagnostics are
37
+ # managed by the client.
38
+ #
39
+ # @return [string]
40
+ def identifier
41
+ attributes.fetch(:identifier)
42
+ end
43
+
44
+ #
45
+ # Whether the language has inter file dependencies meaning that
46
+ # editing code in one file can result in a different diagnostic
47
+ # set in another file. Inter file dependencies are common for
48
+ # most programming languages and typically uncommon for linters.
49
+ #
50
+ # @return [boolean]
51
+ def inter_file_dependencies
52
+ attributes.fetch(:interFileDependencies)
53
+ end
54
+
55
+ #
56
+ # The server provides support for workspace diagnostics as well.
57
+ #
58
+ # @return [boolean]
59
+ def workspace_diagnostics
60
+ attributes.fetch(:workspaceDiagnostics)
61
+ end
62
+
63
+ #
64
+ # The id used to register the request. The id can be used to deregister
65
+ # the request again. See also Registration#id.
66
+ #
67
+ # @return [string]
68
+ def id
69
+ attributes.fetch(:id)
70
+ end
71
+
72
+ attr_reader :attributes
73
+
74
+ def to_hash
75
+ attributes
76
+ end
77
+
78
+ def to_json(*args)
79
+ to_hash.to_json(*args)
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,33 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Cancellation data returned from a diagnostic request.
6
+ #
7
+ class DiagnosticServerCancellationData
8
+ def initialize(retrigger_request:)
9
+ @attributes = {}
10
+
11
+ @attributes[:retriggerRequest] = retrigger_request
12
+
13
+ @attributes.freeze
14
+ end
15
+
16
+ # @return [boolean]
17
+ def retrigger_request
18
+ attributes.fetch(:retriggerRequest)
19
+ end
20
+
21
+ attr_reader :attributes
22
+
23
+ def to_hash
24
+ attributes
25
+ end
26
+
27
+ def to_json(*args)
28
+ to_hash.to_json(*args)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,42 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Workspace client capabilities specific to diagnostic pull requests.
6
+ #
7
+ class DiagnosticWorkspaceClientCapabilities
8
+ def initialize(refresh_support: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:refreshSupport] = refresh_support if refresh_support
12
+
13
+ @attributes.freeze
14
+ end
15
+
16
+ #
17
+ # Whether the client implementation supports a refresh request sent from
18
+ # the server to the client.
19
+ #
20
+ # Note that this event is global and will force the client to refresh all
21
+ # pulled diagnostics currently shown. It should be used with absolute care
22
+ # and is useful for situation where a server for example detects a project
23
+ # wide change that requires such a calculation.
24
+ #
25
+ # @return [boolean]
26
+ def refresh_support
27
+ attributes.fetch(:refreshSupport)
28
+ end
29
+
30
+ attr_reader :attributes
31
+
32
+ def to_hash
33
+ attributes
34
+ end
35
+
36
+ def to_json(*args)
37
+ to_hash.to_json(*args)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -13,7 +13,7 @@ module LanguageServer
13
13
  #
14
14
  # The actual changed settings
15
15
  #
16
- # @return [any]
16
+ # @return [LSPAny]
17
17
  def settings
18
18
  attributes.fetch(:settings)
19
19
  end