language_server-protocol 3.16.0.2 → 3.17.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/language_server/protocol/constant/code_action_kind.rb +8 -0
- data/lib/language_server/protocol/constant/code_action_trigger_kind.rb +22 -0
- data/lib/language_server/protocol/constant/document_diagnostic_report_kind.rb +21 -0
- data/lib/language_server/protocol/constant/error_codes.rb +33 -2
- data/lib/language_server/protocol/constant/folding_range_kind.rb +24 -0
- data/lib/language_server/protocol/constant/{initialize_error.rb → initialize_error_codes.rb} +4 -4
- data/lib/language_server/protocol/constant/inlay_hint_kind.rb +19 -0
- data/lib/language_server/protocol/constant/moniker_kind.rb +24 -0
- data/lib/language_server/protocol/constant/notebook_cell_kind.rb +19 -0
- data/lib/language_server/protocol/constant/position_encoding_kind.rb +32 -0
- data/lib/language_server/protocol/constant/prepare_support_default_behavior.rb +1 -1
- data/lib/language_server/protocol/constant/semantic_token_modifiers.rb +18 -0
- data/lib/language_server/protocol/constant/semantic_token_types.rb +35 -0
- data/lib/language_server/protocol/constant/uniqueness_level.rb +31 -0
- data/lib/language_server/protocol/constant.rb +22 -2
- data/lib/language_server/protocol/interface/{apply_workspace_edit_response.rb → apply_workspace_edit_result.rb} +2 -2
- data/lib/language_server/protocol/interface/call_hierarchy_item.rb +1 -1
- data/lib/language_server/protocol/interface/client_capabilities.rb +13 -4
- data/lib/language_server/protocol/interface/code_action.rb +1 -1
- data/lib/language_server/protocol/interface/code_action_context.rb +10 -1
- data/lib/language_server/protocol/interface/code_lens.rb +1 -1
- data/lib/language_server/protocol/interface/color_presentation.rb +1 -1
- data/lib/language_server/protocol/interface/command.rb +1 -1
- data/lib/language_server/protocol/interface/completion_client_capabilities.rb +23 -3
- data/lib/language_server/protocol/interface/completion_item.rb +41 -9
- data/lib/language_server/protocol/interface/completion_item_label_details.rb +49 -0
- data/lib/language_server/protocol/interface/completion_list.rb +24 -2
- data/lib/language_server/protocol/interface/completion_options.rb +11 -1
- data/lib/language_server/protocol/interface/completion_registration_options.rb +11 -1
- data/lib/language_server/protocol/interface/create_file.rb +1 -1
- data/lib/language_server/protocol/interface/delete_file.rb +1 -1
- data/lib/language_server/protocol/interface/diagnostic_client_capabilities.rb +49 -0
- data/lib/language_server/protocol/interface/diagnostic_options.rb +64 -0
- data/lib/language_server/protocol/interface/diagnostic_registration_options.rb +84 -0
- data/lib/language_server/protocol/interface/diagnostic_server_cancellation_data.rb +33 -0
- data/lib/language_server/protocol/interface/diagnostic_workspace_client_capabilities.rb +42 -0
- data/lib/language_server/protocol/interface/did_change_configuration_params.rb +1 -1
- data/lib/language_server/protocol/interface/did_change_notebook_document_params.rb +56 -0
- data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +11 -1
- data/lib/language_server/protocol/interface/did_close_notebook_document_params.rb +46 -0
- data/lib/language_server/protocol/interface/did_open_notebook_document_params.rb +46 -0
- data/lib/language_server/protocol/interface/did_save_notebook_document_params.rb +36 -0
- data/lib/language_server/protocol/interface/document_diagnostic_params.rb +73 -0
- data/lib/language_server/protocol/interface/document_diagnostic_report_partial_result.rb +33 -0
- data/lib/language_server/protocol/interface/document_link.rb +1 -1
- data/lib/language_server/protocol/interface/document_on_type_formatting_options.rb +1 -1
- data/lib/language_server/protocol/interface/document_on_type_formatting_params.rb +9 -4
- data/lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb +1 -1
- data/lib/language_server/protocol/interface/document_symbol.rb +1 -1
- data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +1 -1
- data/lib/language_server/protocol/interface/execute_command_params.rb +1 -1
- data/lib/language_server/protocol/interface/execution_summary.rb +45 -0
- data/lib/language_server/protocol/interface/file_system_watcher.rb +3 -14
- data/lib/language_server/protocol/interface/folding_range.rb +12 -1
- data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +19 -1
- data/lib/language_server/protocol/interface/full_document_diagnostic_report.rb +56 -0
- data/lib/language_server/protocol/interface/hover_client_capabilities.rb +1 -1
- data/lib/language_server/protocol/interface/hover_result.rb +30 -0
- data/lib/language_server/protocol/interface/initialize_error.rb +0 -3
- data/lib/language_server/protocol/interface/initialize_params.rb +1 -1
- data/lib/language_server/protocol/interface/inlay_hint.rb +122 -0
- data/lib/language_server/protocol/interface/inlay_hint_client_capabilities.rb +46 -0
- data/lib/language_server/protocol/interface/inlay_hint_label_part.rb +79 -0
- data/lib/language_server/protocol/interface/inlay_hint_options.rb +43 -0
- data/lib/language_server/protocol/interface/inlay_hint_params.rb +54 -0
- data/lib/language_server/protocol/interface/inlay_hint_registration_options.rb +63 -0
- data/lib/language_server/protocol/interface/inlay_hint_workspace_client_capabilities.rb +42 -0
- data/lib/language_server/protocol/interface/inline_value_client_capabilities.rb +37 -0
- data/lib/language_server/protocol/interface/inline_value_context.rb +44 -0
- data/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb +52 -0
- data/lib/language_server/protocol/interface/inline_value_options.rb +33 -0
- data/lib/language_server/protocol/interface/inline_value_params.rb +64 -0
- data/lib/language_server/protocol/interface/inline_value_registration_options.rb +53 -0
- data/lib/language_server/protocol/interface/inline_value_text.rb +45 -0
- data/lib/language_server/protocol/interface/inline_value_variable_lookup.rb +61 -0
- data/lib/language_server/protocol/interface/inline_value_workspace_client_capabilities.rb +42 -0
- data/lib/language_server/protocol/interface/linked_editing_ranges.rb +5 -4
- data/lib/language_server/protocol/interface/location_link.rb +1 -1
- data/lib/language_server/protocol/interface/notebook_cell.rb +69 -0
- data/lib/language_server/protocol/interface/notebook_cell_array_change.rb +55 -0
- data/lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb +52 -0
- data/lib/language_server/protocol/interface/notebook_document.rb +74 -0
- data/lib/language_server/protocol/interface/notebook_document_change_event.rb +45 -0
- data/lib/language_server/protocol/interface/notebook_document_client_capabilities.rb +36 -0
- data/lib/language_server/protocol/interface/notebook_document_filter.rb +79 -0
- data/lib/language_server/protocol/interface/notebook_document_identifier.rb +36 -0
- data/lib/language_server/protocol/interface/notebook_document_sync_client_capabilities.rb +48 -0
- data/lib/language_server/protocol/interface/notebook_document_sync_options.rb +56 -0
- data/lib/language_server/protocol/interface/notebook_document_sync_registration_options.rb +56 -0
- data/lib/language_server/protocol/interface/position.rb +2 -3
- data/lib/language_server/protocol/interface/prepare_rename_params.rb +10 -1
- data/lib/language_server/protocol/interface/previous_result_id.rb +46 -0
- data/lib/language_server/protocol/interface/registration.rb +1 -1
- data/lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb +69 -0
- data/lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb +62 -0
- data/lib/language_server/protocol/interface/relative_pattern.rb +48 -0
- data/lib/language_server/protocol/interface/rename_client_capabilities.rb +1 -1
- data/lib/language_server/protocol/interface/rename_file.rb +1 -1
- data/lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb +29 -1
- data/lib/language_server/protocol/interface/server_capabilities.rb +62 -2
- data/lib/language_server/protocol/interface/signature_help.rb +2 -2
- data/lib/language_server/protocol/interface/symbol_information.rb +1 -1
- data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +37 -1
- data/lib/language_server/protocol/interface/text_document_content_change_event.rb +2 -2
- data/lib/language_server/protocol/interface/text_document_sync_options.rb +2 -0
- data/lib/language_server/protocol/interface/type_hierarchy_item.rb +102 -0
- data/lib/language_server/protocol/interface/type_hierarchy_options.rb +30 -0
- data/lib/language_server/protocol/interface/type_hierarchy_prepare_params.rb +51 -0
- data/lib/language_server/protocol/interface/type_hierarchy_registration_options.rb +50 -0
- data/lib/language_server/protocol/interface/type_hierarchy_subtypes_params.rb +49 -0
- data/lib/language_server/protocol/interface/type_hierarchy_supertypes_params.rb +49 -0
- data/lib/language_server/protocol/interface/unchanged_document_diagnostic_report.rb +50 -0
- data/lib/language_server/protocol/interface/{markdown_client_capabilities.rb → versioned_notebook_document_identifier.rb} +12 -12
- data/lib/language_server/protocol/interface/work_done_progress_report.rb +1 -1
- data/lib/language_server/protocol/interface/workspace_diagnostic_params.rb +65 -0
- data/lib/language_server/protocol/interface/workspace_diagnostic_report.rb +33 -0
- data/lib/language_server/protocol/interface/workspace_diagnostic_report_partial_result.rb +33 -0
- data/lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb +75 -0
- data/lib/language_server/protocol/interface/workspace_symbol.rb +89 -0
- data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +14 -3
- data/lib/language_server/protocol/interface/workspace_symbol_options.rb +11 -1
- data/lib/language_server/protocol/interface/workspace_symbol_registration_options.rb +11 -1
- data/lib/language_server/protocol/interface/workspace_unchanged_document_diagnostic_report.rb +68 -0
- data/lib/language_server/protocol/interface.rb +124 -4
- data/lib/language_server/protocol/transport/io/reader.rb +7 -24
- data/lib/language_server/protocol/version.rb +1 -1
- 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?:
|
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.
|
31
|
-
#
|
32
|
-
#
|
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 [
|
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 `
|
164
|
-
# `textDocument.completion.insertReplaceSupport` client
|
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 [
|
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
|
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
|
@@ -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
|