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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/language_server/protocol/constant.rb +10 -0
- data/lib/language_server/protocol/constant/code_action_kind.rb +6 -4
- data/lib/language_server/protocol/constant/completion_item_tag.rb +2 -2
- data/lib/language_server/protocol/constant/completion_trigger_kind.rb +2 -1
- data/lib/language_server/protocol/constant/diagnostic_tag.rb +2 -2
- data/lib/language_server/protocol/constant/error_codes.rb +26 -3
- data/lib/language_server/protocol/constant/failure_handling_kind.rb +6 -5
- data/lib/language_server/protocol/constant/file_operation_pattern_kind.rb +20 -0
- data/lib/language_server/protocol/constant/initialize_error.rb +2 -1
- data/lib/language_server/protocol/constant/insert_text_mode.rb +30 -0
- data/lib/language_server/protocol/constant/prepare_support_default_behavior.rb +13 -0
- data/lib/language_server/protocol/constant/signature_help_trigger_kind.rb +2 -1
- data/lib/language_server/protocol/constant/symbol_tag.rb +15 -0
- data/lib/language_server/protocol/constant/text_document_save_reason.rb +2 -2
- data/lib/language_server/protocol/constant/text_document_sync_kind.rb +2 -2
- data/lib/language_server/protocol/constant/token_format.rb +9 -0
- data/lib/language_server/protocol/interface.rb +112 -0
- data/lib/language_server/protocol/interface/annotated_text_edit.rb +38 -0
- data/lib/language_server/protocol/interface/apply_workspace_edit_response.rb +15 -4
- data/lib/language_server/protocol/interface/call_hierarchy_client_capabilities.rb +36 -0
- data/lib/language_server/protocol/interface/call_hierarchy_incoming_call.rb +43 -0
- data/lib/language_server/protocol/interface/call_hierarchy_incoming_calls_params.rb +31 -0
- data/lib/language_server/protocol/interface/call_hierarchy_item.rb +100 -0
- data/lib/language_server/protocol/interface/call_hierarchy_options.rb +25 -0
- data/lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb +43 -0
- data/lib/language_server/protocol/interface/call_hierarchy_outgoing_calls_params.rb +31 -0
- data/lib/language_server/protocol/interface/call_hierarchy_prepare_params.rb +25 -0
- data/lib/language_server/protocol/interface/call_hierarchy_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/change_annotation.rb +57 -0
- data/lib/language_server/protocol/interface/client_capabilities.rb +12 -3
- data/lib/language_server/protocol/interface/code_action.rb +43 -8
- data/lib/language_server/protocol/interface/code_action_client_capabilities.rb +44 -1
- data/lib/language_server/protocol/interface/code_action_context.rb +7 -6
- data/lib/language_server/protocol/interface/code_action_options.rb +13 -3
- data/lib/language_server/protocol/interface/code_action_registration_options.rb +2 -1
- data/lib/language_server/protocol/interface/code_description.rb +36 -0
- data/lib/language_server/protocol/interface/code_lens.rb +5 -3
- data/lib/language_server/protocol/interface/code_lens_workspace_client_capabilities.rb +39 -0
- data/lib/language_server/protocol/interface/color_presentation.rb +7 -6
- data/lib/language_server/protocol/interface/completion_client_capabilities.rb +1 -1
- data/lib/language_server/protocol/interface/completion_context.rb +5 -3
- data/lib/language_server/protocol/interface/completion_item.rb +60 -29
- data/lib/language_server/protocol/interface/completion_list.rb +2 -2
- data/lib/language_server/protocol/interface/completion_options.rb +15 -12
- data/lib/language_server/protocol/interface/completion_params.rb +2 -1
- data/lib/language_server/protocol/interface/create_file.rb +10 -1
- data/lib/language_server/protocol/interface/create_files_params.rb +37 -0
- data/lib/language_server/protocol/interface/declaration_client_capabilities.rb +3 -3
- data/lib/language_server/protocol/interface/delete_file.rb +10 -1
- data/lib/language_server/protocol/interface/delete_files_params.rb +37 -0
- data/lib/language_server/protocol/interface/diagnostic.rb +21 -1
- data/lib/language_server/protocol/interface/diagnostic_related_information.rb +3 -3
- data/lib/language_server/protocol/interface/did_change_text_document_params.rb +11 -9
- data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +3 -3
- data/lib/language_server/protocol/interface/document_filter.rb +7 -3
- data/lib/language_server/protocol/interface/document_highlight.rb +1 -1
- data/lib/language_server/protocol/interface/document_link.rb +6 -5
- data/lib/language_server/protocol/interface/document_symbol.rb +23 -11
- data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +24 -2
- data/lib/language_server/protocol/interface/document_symbol_options.rb +11 -1
- data/lib/language_server/protocol/interface/document_symbol_registration_options.rb +2 -1
- data/lib/language_server/protocol/interface/file_create.rb +36 -0
- data/lib/language_server/protocol/interface/file_delete.rb +36 -0
- data/lib/language_server/protocol/interface/file_operation_filter.rb +46 -0
- data/lib/language_server/protocol/interface/file_operation_pattern.rb +67 -0
- data/lib/language_server/protocol/interface/file_operation_pattern_options.rb +36 -0
- data/lib/language_server/protocol/interface/file_operation_registration_options.rb +36 -0
- data/lib/language_server/protocol/interface/file_rename.rb +45 -0
- data/lib/language_server/protocol/interface/file_system_watcher.rb +7 -3
- data/lib/language_server/protocol/interface/folding_range.rb +17 -8
- data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +10 -7
- data/lib/language_server/protocol/interface/hover.rb +1 -1
- data/lib/language_server/protocol/interface/hover_client_capabilities.rb +3 -2
- data/lib/language_server/protocol/interface/implementation_client_capabilities.rb +3 -3
- data/lib/language_server/protocol/interface/initialize_params.rb +20 -5
- data/lib/language_server/protocol/interface/insert_replace_edit.rb +54 -0
- data/lib/language_server/protocol/interface/linked_editing_range_client_capabilities.rb +36 -0
- data/lib/language_server/protocol/interface/linked_editing_range_options.rb +25 -0
- data/lib/language_server/protocol/interface/linked_editing_range_params.rb +25 -0
- data/lib/language_server/protocol/interface/linked_editing_range_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/linked_editing_ranges.rb +45 -0
- data/lib/language_server/protocol/interface/location_link.rb +9 -7
- data/lib/language_server/protocol/interface/log_message_params.rb +1 -1
- data/lib/language_server/protocol/interface/log_trace_params.rb +43 -0
- data/lib/language_server/protocol/interface/markdown_client_capabilities.rb +45 -0
- data/lib/language_server/protocol/interface/markup_content.rb +9 -7
- data/lib/language_server/protocol/interface/moniker.rb +64 -0
- data/lib/language_server/protocol/interface/moniker_client_capabilities.rb +36 -0
- data/lib/language_server/protocol/interface/moniker_options.rb +25 -0
- data/lib/language_server/protocol/interface/moniker_params.rb +25 -0
- data/lib/language_server/protocol/interface/moniker_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb +42 -0
- data/lib/language_server/protocol/interface/parameter_information.rb +7 -5
- data/lib/language_server/protocol/interface/partial_result_params.rb +3 -3
- data/lib/language_server/protocol/interface/position.rb +5 -5
- data/lib/language_server/protocol/interface/progress_params.rb +1 -1
- data/lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb +21 -1
- data/lib/language_server/protocol/interface/publish_diagnostics_params.rb +2 -1
- data/lib/language_server/protocol/interface/regular_expressions_client_capabilities.rb +45 -0
- data/lib/language_server/protocol/interface/rename_client_capabilities.rb +27 -1
- data/lib/language_server/protocol/interface/rename_file.rb +10 -1
- data/lib/language_server/protocol/interface/rename_files_params.rb +38 -0
- data/lib/language_server/protocol/interface/selection_range.rb +2 -1
- data/lib/language_server/protocol/interface/selection_range_client_capabilities.rb +4 -3
- data/lib/language_server/protocol/interface/semantic_tokens.rb +45 -0
- data/lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb +97 -0
- data/lib/language_server/protocol/interface/semantic_tokens_delta.rb +40 -0
- data/lib/language_server/protocol/interface/semantic_tokens_delta_params.rb +44 -0
- data/lib/language_server/protocol/interface/semantic_tokens_delta_partial_result.rb +30 -0
- data/lib/language_server/protocol/interface/semantic_tokens_edit.rb +51 -0
- data/lib/language_server/protocol/interface/semantic_tokens_legend.rb +42 -0
- data/lib/language_server/protocol/interface/semantic_tokens_options.rb +53 -0
- data/lib/language_server/protocol/interface/semantic_tokens_params.rb +34 -0
- data/lib/language_server/protocol/interface/semantic_tokens_partial_result.rb +30 -0
- data/lib/language_server/protocol/interface/semantic_tokens_range_params.rb +43 -0
- data/lib/language_server/protocol/interface/semantic_tokens_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb +39 -0
- data/lib/language_server/protocol/interface/server_capabilities.rb +47 -9
- data/lib/language_server/protocol/interface/set_trace_params.rb +33 -0
- data/lib/language_server/protocol/interface/show_document_client_capabilities.rb +37 -0
- data/lib/language_server/protocol/interface/show_document_params.rb +71 -0
- data/lib/language_server/protocol/interface/show_document_result.rb +36 -0
- data/lib/language_server/protocol/interface/show_message_params.rb +1 -1
- data/lib/language_server/protocol/interface/show_message_request_client_capabilities.rb +36 -0
- data/lib/language_server/protocol/interface/show_message_request_params.rb +1 -1
- data/lib/language_server/protocol/interface/signature_help.rb +3 -3
- data/lib/language_server/protocol/interface/signature_help_client_capabilities.rb +1 -1
- data/lib/language_server/protocol/interface/signature_help_context.rb +10 -7
- data/lib/language_server/protocol/interface/signature_help_options.rb +3 -2
- data/lib/language_server/protocol/interface/signature_help_params.rb +3 -2
- data/lib/language_server/protocol/interface/signature_information.rb +12 -1
- data/lib/language_server/protocol/interface/symbol_information.rb +10 -1
- data/lib/language_server/protocol/interface/text_document_change_registration_options.rb +1 -1
- data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +39 -2
- data/lib/language_server/protocol/interface/text_document_content_change_event.rb +2 -2
- data/lib/language_server/protocol/interface/text_document_edit.rb +2 -2
- data/lib/language_server/protocol/interface/text_document_registration_options.rb +3 -3
- data/lib/language_server/protocol/interface/text_document_sync_options.rb +13 -15
- data/lib/language_server/protocol/interface/type_definition_client_capabilities.rb +3 -3
- data/lib/language_server/protocol/interface/versioned_text_document_identifier.rb +3 -7
- data/lib/language_server/protocol/interface/will_save_text_document_params.rb +1 -1
- data/lib/language_server/protocol/interface/work_done_progress_begin.rb +3 -3
- data/lib/language_server/protocol/interface/work_done_progress_cancel_params.rb +1 -1
- data/lib/language_server/protocol/interface/work_done_progress_create_params.rb +1 -1
- data/lib/language_server/protocol/interface/work_done_progress_params.rb +1 -1
- data/lib/language_server/protocol/interface/work_done_progress_report.rb +5 -5
- data/lib/language_server/protocol/interface/workspace_edit.rb +24 -7
- data/lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb +23 -1
- data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +13 -2
- data/lib/language_server/protocol/version.rb +1 -1
- metadata +67 -6
@@ -7,12 +7,13 @@ module LanguageServer
|
|
7
7
|
# a set of parameters.
|
8
8
|
#
|
9
9
|
class SignatureInformation
|
10
|
-
def initialize(label:, documentation: nil, parameters: nil)
|
10
|
+
def initialize(label:, documentation: nil, parameters: nil, active_parameter: nil)
|
11
11
|
@attributes = {}
|
12
12
|
|
13
13
|
@attributes[:label] = label
|
14
14
|
@attributes[:documentation] = documentation if documentation
|
15
15
|
@attributes[:parameters] = parameters if parameters
|
16
|
+
@attributes[:activeParameter] = active_parameter if active_parameter
|
16
17
|
|
17
18
|
@attributes.freeze
|
18
19
|
end
|
@@ -43,6 +44,16 @@ module LanguageServer
|
|
43
44
|
attributes.fetch(:parameters)
|
44
45
|
end
|
45
46
|
|
47
|
+
#
|
48
|
+
# The index of the active parameter.
|
49
|
+
#
|
50
|
+
# If provided, this is used in place of `SignatureHelp.activeParameter`.
|
51
|
+
#
|
52
|
+
# @return [number]
|
53
|
+
def active_parameter
|
54
|
+
attributes.fetch(:activeParameter)
|
55
|
+
end
|
56
|
+
|
46
57
|
attr_reader :attributes
|
47
58
|
|
48
59
|
def to_hash
|
@@ -6,11 +6,12 @@ module LanguageServer
|
|
6
6
|
# interfaces etc.
|
7
7
|
#
|
8
8
|
class SymbolInformation
|
9
|
-
def initialize(name:, kind:, deprecated: nil, location:, container_name: nil)
|
9
|
+
def initialize(name:, kind:, tags: nil, deprecated: nil, location:, container_name: nil)
|
10
10
|
@attributes = {}
|
11
11
|
|
12
12
|
@attributes[:name] = name
|
13
13
|
@attributes[:kind] = kind
|
14
|
+
@attributes[:tags] = tags if tags
|
14
15
|
@attributes[:deprecated] = deprecated if deprecated
|
15
16
|
@attributes[:location] = location
|
16
17
|
@attributes[:containerName] = container_name if container_name
|
@@ -34,6 +35,14 @@ module LanguageServer
|
|
34
35
|
attributes.fetch(:kind)
|
35
36
|
end
|
36
37
|
|
38
|
+
#
|
39
|
+
# Tags for this symbol.
|
40
|
+
#
|
41
|
+
# @return [1[]]
|
42
|
+
def tags
|
43
|
+
attributes.fetch(:tags)
|
44
|
+
end
|
45
|
+
|
37
46
|
#
|
38
47
|
# Indicates if this symbol is deprecated.
|
39
48
|
#
|
@@ -5,7 +5,7 @@ module LanguageServer
|
|
5
5
|
# Text document specific client capabilities.
|
6
6
|
#
|
7
7
|
class TextDocumentClientCapabilities
|
8
|
-
def initialize(synchronization: nil, completion: nil, hover: nil, signature_help: nil, declaration: nil, definition: nil, type_definition: nil, implementation: nil, references: nil, document_highlight: nil, document_symbol: nil, code_action: nil, code_lens: nil, document_link: nil, color_provider: nil, formatting: nil, range_formatting: nil, on_type_formatting: nil, rename: nil, publish_diagnostics: nil, folding_range: nil, selection_range: nil)
|
8
|
+
def initialize(synchronization: nil, completion: nil, hover: nil, signature_help: nil, declaration: nil, definition: nil, type_definition: nil, implementation: nil, references: nil, document_highlight: nil, document_symbol: nil, code_action: nil, code_lens: nil, document_link: nil, color_provider: nil, formatting: nil, range_formatting: nil, on_type_formatting: nil, rename: nil, publish_diagnostics: nil, folding_range: nil, selection_range: nil, linked_editing_range: nil, call_hierarchy: nil, semantic_tokens: nil, moniker: nil)
|
9
9
|
@attributes = {}
|
10
10
|
|
11
11
|
@attributes[:synchronization] = synchronization if synchronization
|
@@ -30,6 +30,10 @@ module LanguageServer
|
|
30
30
|
@attributes[:publishDiagnostics] = publish_diagnostics if publish_diagnostics
|
31
31
|
@attributes[:foldingRange] = folding_range if folding_range
|
32
32
|
@attributes[:selectionRange] = selection_range if selection_range
|
33
|
+
@attributes[:linkedEditingRange] = linked_editing_range if linked_editing_range
|
34
|
+
@attributes[:callHierarchy] = call_hierarchy if call_hierarchy
|
35
|
+
@attributes[:semanticTokens] = semantic_tokens if semantic_tokens
|
36
|
+
@attributes[:moniker] = moniker if moniker
|
33
37
|
|
34
38
|
@attributes.freeze
|
35
39
|
end
|
@@ -186,7 +190,8 @@ module LanguageServer
|
|
186
190
|
end
|
187
191
|
|
188
192
|
#
|
189
|
-
# Capabilities specific to the `textDocument/publishDiagnostics`
|
193
|
+
# Capabilities specific to the `textDocument/publishDiagnostics`
|
194
|
+
# notification.
|
190
195
|
#
|
191
196
|
# @return [PublishDiagnosticsClientCapabilities]
|
192
197
|
def publish_diagnostics
|
@@ -209,6 +214,38 @@ module LanguageServer
|
|
209
214
|
attributes.fetch(:selectionRange)
|
210
215
|
end
|
211
216
|
|
217
|
+
#
|
218
|
+
# Capabilities specific to the `textDocument/linkedEditingRange` request.
|
219
|
+
#
|
220
|
+
# @return [LinkedEditingRangeClientCapabilities]
|
221
|
+
def linked_editing_range
|
222
|
+
attributes.fetch(:linkedEditingRange)
|
223
|
+
end
|
224
|
+
|
225
|
+
#
|
226
|
+
# Capabilities specific to the various call hierarchy requests.
|
227
|
+
#
|
228
|
+
# @return [CallHierarchyClientCapabilities]
|
229
|
+
def call_hierarchy
|
230
|
+
attributes.fetch(:callHierarchy)
|
231
|
+
end
|
232
|
+
|
233
|
+
#
|
234
|
+
# Capabilities specific to the various semantic token requests.
|
235
|
+
#
|
236
|
+
# @return [SemanticTokensClientCapabilities]
|
237
|
+
def semantic_tokens
|
238
|
+
attributes.fetch(:semanticTokens)
|
239
|
+
end
|
240
|
+
|
241
|
+
#
|
242
|
+
# Capabilities specific to the `textDocument/moniker` request.
|
243
|
+
#
|
244
|
+
# @return [MonikerClientCapabilities]
|
245
|
+
def moniker
|
246
|
+
attributes.fetch(:moniker)
|
247
|
+
end
|
248
|
+
|
212
249
|
attr_reader :attributes
|
213
250
|
|
214
251
|
def to_hash
|
@@ -2,8 +2,8 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
#
|
5
|
-
# An event describing a change to a text document. If range and rangeLength are
|
6
|
-
# the new text is considered to be the full content of the document.
|
5
|
+
# An event describing a change to a text document. If range and rangeLength are
|
6
|
+
# omitted the new text is considered to be the full content of the document.
|
7
7
|
#
|
8
8
|
class TextDocumentContentChangeEvent
|
9
9
|
def initialize(range: nil, range_length: nil, text:)
|
@@ -14,7 +14,7 @@ module LanguageServer
|
|
14
14
|
#
|
15
15
|
# The text document to change.
|
16
16
|
#
|
17
|
-
# @return [
|
17
|
+
# @return [OptionalVersionedTextDocumentIdentifier]
|
18
18
|
def text_document
|
19
19
|
attributes.fetch(:textDocument)
|
20
20
|
end
|
@@ -22,7 +22,7 @@ module LanguageServer
|
|
22
22
|
#
|
23
23
|
# The edits to be applied.
|
24
24
|
#
|
25
|
-
# @return [TextEdit[]]
|
25
|
+
# @return [(TextEdit | AnnotatedTextEdit)[]]
|
26
26
|
def edits
|
27
27
|
attributes.fetch(:edits)
|
28
28
|
end
|
@@ -14,10 +14,10 @@ module LanguageServer
|
|
14
14
|
end
|
15
15
|
|
16
16
|
#
|
17
|
-
# A document selector to identify the scope of the registration. If set to
|
18
|
-
# the document selector provided on the client side will be used.
|
17
|
+
# A document selector to identify the scope of the registration. If set to
|
18
|
+
# null the document selector provided on the client side will be used.
|
19
19
|
#
|
20
|
-
# @return [
|
20
|
+
# @return [DocumentSelector]
|
21
21
|
def document_selector
|
22
22
|
attributes.fetch(:documentSelector)
|
23
23
|
end
|
@@ -15,10 +15,8 @@ module LanguageServer
|
|
15
15
|
end
|
16
16
|
|
17
17
|
#
|
18
|
-
# Open and close notifications are sent to the server. If omitted open
|
19
|
-
# be sent.
|
20
|
-
# Open and close notifications are sent to the server. If omitted open close notification should not
|
21
|
-
# be sent.
|
18
|
+
# Open and close notifications are sent to the server. If omitted open
|
19
|
+
# close notification should not be sent.
|
22
20
|
#
|
23
21
|
# @return [boolean]
|
24
22
|
def open_close
|
@@ -26,19 +24,19 @@ module LanguageServer
|
|
26
24
|
end
|
27
25
|
|
28
26
|
#
|
29
|
-
# Change notifications are sent to the server. See
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
27
|
+
# Change notifications are sent to the server. See
|
28
|
+
# TextDocumentSyncKind.None, TextDocumentSyncKind.Full and
|
29
|
+
# TextDocumentSyncKind.Incremental. If omitted it defaults to
|
30
|
+
# TextDocumentSyncKind.None.
|
33
31
|
#
|
34
|
-
# @return [
|
32
|
+
# @return [TextDocumentSyncKind]
|
35
33
|
def change
|
36
34
|
attributes.fetch(:change)
|
37
35
|
end
|
38
36
|
|
39
37
|
#
|
40
|
-
# If present will save notifications are sent to the server. If omitted
|
41
|
-
# sent.
|
38
|
+
# If present will save notifications are sent to the server. If omitted
|
39
|
+
# the notification should not be sent.
|
42
40
|
#
|
43
41
|
# @return [boolean]
|
44
42
|
def will_save
|
@@ -46,8 +44,8 @@ module LanguageServer
|
|
46
44
|
end
|
47
45
|
|
48
46
|
#
|
49
|
-
# If present will save wait until requests are sent to the server. If
|
50
|
-
# sent.
|
47
|
+
# If present will save wait until requests are sent to the server. If
|
48
|
+
# omitted the request should not be sent.
|
51
49
|
#
|
52
50
|
# @return [boolean]
|
53
51
|
def will_save_wait_until
|
@@ -55,8 +53,8 @@ module LanguageServer
|
|
55
53
|
end
|
56
54
|
|
57
55
|
#
|
58
|
-
# If present save notifications are sent to the server. If omitted the
|
59
|
-
# sent.
|
56
|
+
# If present save notifications are sent to the server. If omitted the
|
57
|
+
# notification should not be sent.
|
60
58
|
#
|
61
59
|
# @return [boolean | SaveOptions]
|
62
60
|
def save
|
@@ -12,9 +12,9 @@ module LanguageServer
|
|
12
12
|
end
|
13
13
|
|
14
14
|
#
|
15
|
-
# Whether implementation supports dynamic registration. If this is set to
|
16
|
-
# the client supports the new `TypeDefinitionRegistrationOptions`
|
17
|
-
# for the corresponding server capability as well.
|
15
|
+
# Whether implementation supports dynamic registration. If this is set to
|
16
|
+
# `true` the client supports the new `TypeDefinitionRegistrationOptions`
|
17
|
+
# return value for the corresponding server capability as well.
|
18
18
|
#
|
19
19
|
# @return [boolean]
|
20
20
|
def dynamic_registration
|
@@ -12,14 +12,10 @@ module LanguageServer
|
|
12
12
|
end
|
13
13
|
|
14
14
|
#
|
15
|
-
# The version number of this document.
|
16
|
-
# is sent from the server to the client and the file is not open in the editor
|
17
|
-
# (the server has not received an open notification before) the server can send
|
18
|
-
# `null` to indicate that the version is known and the content on disk is the
|
19
|
-
# master (as speced with document content ownership).
|
15
|
+
# The version number of this document.
|
20
16
|
#
|
21
|
-
# The version number of a document will increase after each change,
|
22
|
-
# undo/redo. The number doesn't need to be consecutive.
|
17
|
+
# The version number of a document will increase after each change,
|
18
|
+
# including undo/redo. The number doesn't need to be consecutive.
|
23
19
|
#
|
24
20
|
# @return [number]
|
25
21
|
def version
|
@@ -32,8 +32,8 @@ module LanguageServer
|
|
32
32
|
|
33
33
|
#
|
34
34
|
# Controls if a cancel button should show to allow the user to cancel the
|
35
|
-
# long running operation. Clients that don't support cancellation are
|
36
|
-
# to ignore the setting.
|
35
|
+
# long running operation. Clients that don't support cancellation are
|
36
|
+
# allowed to ignore the setting.
|
37
37
|
#
|
38
38
|
# @return [boolean]
|
39
39
|
def cancellable
|
@@ -58,7 +58,7 @@ module LanguageServer
|
|
58
58
|
# to ignore the `percentage` value in subsequent in report notifications.
|
59
59
|
#
|
60
60
|
# The value should be steadily rising. Clients are free to ignore values
|
61
|
-
# that are not following this rule.
|
61
|
+
# that are not following this rule. The value range is [0, 100]
|
62
62
|
#
|
63
63
|
# @return [number]
|
64
64
|
def percentage
|
@@ -19,11 +19,11 @@ module LanguageServer
|
|
19
19
|
end
|
20
20
|
|
21
21
|
#
|
22
|
-
# Controls enablement state of a cancel button. This property is only valid
|
23
|
-
# button got requested in the `WorkDoneProgressStart` payload.
|
22
|
+
# Controls enablement state of a cancel button. This property is only valid
|
23
|
+
# if a cancel button got requested in the `WorkDoneProgressStart` payload.
|
24
24
|
#
|
25
|
-
# Clients that don't support cancellation or don't support control the
|
26
|
-
# enablement state are allowed to ignore the setting.
|
25
|
+
# Clients that don't support cancellation or don't support control the
|
26
|
+
# button's enablement state are allowed to ignore the setting.
|
27
27
|
#
|
28
28
|
# @return [boolean]
|
29
29
|
def cancellable
|
@@ -48,7 +48,7 @@ module LanguageServer
|
|
48
48
|
# to ignore the `percentage` value in subsequent in report notifications.
|
49
49
|
#
|
50
50
|
# The value should be steadily rising. Clients are free to ignore values
|
51
|
-
# that are not following this rule.
|
51
|
+
# that are not following this rule. The value range is [0, 100]
|
52
52
|
#
|
53
53
|
# @return [number]
|
54
54
|
def percentage
|
@@ -2,11 +2,12 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
class WorkspaceEdit
|
5
|
-
def initialize(changes: nil, document_changes: nil)
|
5
|
+
def initialize(changes: nil, document_changes: nil, change_annotations: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
8
|
@attributes[:changes] = changes if changes
|
9
9
|
@attributes[:documentChanges] = document_changes if document_changes
|
10
|
+
@attributes[:changeAnnotations] = change_annotations if change_annotations
|
10
11
|
|
11
12
|
@attributes.freeze
|
12
13
|
end
|
@@ -20,22 +21,38 @@ module LanguageServer
|
|
20
21
|
end
|
21
22
|
|
22
23
|
#
|
23
|
-
# Depending on the client capability
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
24
|
+
# Depending on the client capability
|
25
|
+
# `workspace.workspaceEdit.resourceOperations` document changes are either
|
26
|
+
# an array of `TextDocumentEdit`s to express changes to n different text
|
27
|
+
# documents where each text document edit addresses a specific version of
|
28
|
+
# a text document. Or it can contain above `TextDocumentEdit`s mixed with
|
29
|
+
# create, rename and delete file / folder operations.
|
27
30
|
#
|
28
31
|
# Whether a client supports versioned document edits is expressed via
|
29
32
|
# `workspace.workspaceEdit.documentChanges` client capability.
|
30
33
|
#
|
31
|
-
# If a client neither supports `documentChanges` nor
|
32
|
-
# only plain `TextEdit`s
|
34
|
+
# If a client neither supports `documentChanges` nor
|
35
|
+
# `workspace.workspaceEdit.resourceOperations` then only plain `TextEdit`s
|
36
|
+
# using the `changes` property are supported.
|
33
37
|
#
|
34
38
|
# @return [TextDocumentEdit[] | (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[]]
|
35
39
|
def document_changes
|
36
40
|
attributes.fetch(:documentChanges)
|
37
41
|
end
|
38
42
|
|
43
|
+
#
|
44
|
+
# A map of change annotations that can be referenced in
|
45
|
+
# `AnnotatedTextEdit`s or create, rename and delete file / folder
|
46
|
+
# operations.
|
47
|
+
#
|
48
|
+
# Whether clients honor this property depends on the client capability
|
49
|
+
# `workspace.changeAnnotationSupport`.
|
50
|
+
#
|
51
|
+
# @return [{ [id: string]: ChangeAnnotation; }]
|
52
|
+
def change_annotations
|
53
|
+
attributes.fetch(:changeAnnotations)
|
54
|
+
end
|
55
|
+
|
39
56
|
attr_reader :attributes
|
40
57
|
|
41
58
|
def to_hash
|
@@ -2,12 +2,14 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
class WorkspaceEditClientCapabilities
|
5
|
-
def initialize(document_changes: nil, resource_operations: nil, failure_handling: nil)
|
5
|
+
def initialize(document_changes: nil, resource_operations: nil, failure_handling: nil, normalizes_line_endings: nil, change_annotation_support: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
8
|
@attributes[:documentChanges] = document_changes if document_changes
|
9
9
|
@attributes[:resourceOperations] = resource_operations if resource_operations
|
10
10
|
@attributes[:failureHandling] = failure_handling if failure_handling
|
11
|
+
@attributes[:normalizesLineEndings] = normalizes_line_endings if normalizes_line_endings
|
12
|
+
@attributes[:changeAnnotationSupport] = change_annotation_support if change_annotation_support
|
11
13
|
|
12
14
|
@attributes.freeze
|
13
15
|
end
|
@@ -38,6 +40,26 @@ module LanguageServer
|
|
38
40
|
attributes.fetch(:failureHandling)
|
39
41
|
end
|
40
42
|
|
43
|
+
#
|
44
|
+
# Whether the client normalizes line endings to the client specific
|
45
|
+
# setting.
|
46
|
+
# If set to `true` the client will normalize line ending characters
|
47
|
+
# in a workspace edit to the client specific new line character(s).
|
48
|
+
#
|
49
|
+
# @return [boolean]
|
50
|
+
def normalizes_line_endings
|
51
|
+
attributes.fetch(:normalizesLineEndings)
|
52
|
+
end
|
53
|
+
|
54
|
+
#
|
55
|
+
# Whether the client in general supports change annotations on text edits,
|
56
|
+
# create file, rename file and delete file changes.
|
57
|
+
#
|
58
|
+
# @return [{ groupsOnLabel?: boolean; }]
|
59
|
+
def change_annotation_support
|
60
|
+
attributes.fetch(:changeAnnotationSupport)
|
61
|
+
end
|
62
|
+
|
41
63
|
attr_reader :attributes
|
42
64
|
|
43
65
|
def to_hash
|