language_server-protocol 3.15.0.2 → 3.16.0.3
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 +3 -1
- 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/constant.rb +10 -0
- data/lib/language_server/protocol/interface/annotated_text_edit.rb +56 -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 +49 -0
- data/lib/language_server/protocol/interface/call_hierarchy_item.rb +100 -0
- data/lib/language_server/protocol/interface/call_hierarchy_options.rb +30 -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 +49 -0
- data/lib/language_server/protocol/interface/call_hierarchy_prepare_params.rb +51 -0
- data/lib/language_server/protocol/interface/call_hierarchy_registration_options.rb +50 -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 +19 -4
- data/lib/language_server/protocol/interface/code_action_params.rb +20 -2
- data/lib/language_server/protocol/interface/code_action_registration_options.rb +38 -2
- 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_options.rb +6 -1
- data/lib/language_server/protocol/interface/code_lens_params.rb +20 -2
- data/lib/language_server/protocol/interface/code_lens_registration_options.rb +25 -2
- 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/color_presentation_params.rb +20 -2
- 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 +21 -13
- data/lib/language_server/protocol/interface/completion_params.rb +40 -3
- data/lib/language_server/protocol/interface/completion_registration_options.rb +57 -2
- 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/declaration_options.rb +6 -1
- data/lib/language_server/protocol/interface/declaration_params.rb +38 -2
- data/lib/language_server/protocol/interface/declaration_registration_options.rb +27 -2
- data/lib/language_server/protocol/interface/definition_options.rb +6 -1
- data/lib/language_server/protocol/interface/definition_params.rb +38 -2
- data/lib/language_server/protocol/interface/definition_registration_options.rb +17 -2
- 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_color_options.rb +6 -1
- data/lib/language_server/protocol/interface/document_color_params.rb +20 -2
- data/lib/language_server/protocol/interface/document_color_registration_options.rb +27 -2
- data/lib/language_server/protocol/interface/document_filter.rb +7 -3
- data/lib/language_server/protocol/interface/document_formatting_options.rb +6 -1
- data/lib/language_server/protocol/interface/document_formatting_params.rb +9 -1
- data/lib/language_server/protocol/interface/document_formatting_registration_options.rb +17 -2
- data/lib/language_server/protocol/interface/document_highlight.rb +1 -1
- data/lib/language_server/protocol/interface/document_highlight_options.rb +6 -1
- data/lib/language_server/protocol/interface/document_highlight_params.rb +38 -2
- data/lib/language_server/protocol/interface/document_highlight_registration_options.rb +17 -2
- data/lib/language_server/protocol/interface/document_link.rb +6 -5
- data/lib/language_server/protocol/interface/document_link_options.rb +6 -1
- data/lib/language_server/protocol/interface/document_link_params.rb +20 -2
- data/lib/language_server/protocol/interface/document_link_registration_options.rb +25 -2
- data/lib/language_server/protocol/interface/document_on_type_formatting_params.rb +17 -1
- data/lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb +28 -2
- data/lib/language_server/protocol/interface/document_range_formatting_options.rb +6 -1
- data/lib/language_server/protocol/interface/document_range_formatting_params.rb +9 -1
- data/lib/language_server/protocol/interface/document_range_formatting_registration_options.rb +17 -2
- 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 +17 -2
- data/lib/language_server/protocol/interface/document_symbol_params.rb +20 -2
- data/lib/language_server/protocol/interface/document_symbol_registration_options.rb +27 -2
- data/lib/language_server/protocol/interface/execute_command_options.rb +6 -1
- data/lib/language_server/protocol/interface/execute_command_params.rb +9 -1
- data/lib/language_server/protocol/interface/execute_command_registration_options.rb +14 -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/folding_range_options.rb +6 -1
- data/lib/language_server/protocol/interface/folding_range_params.rb +20 -2
- data/lib/language_server/protocol/interface/folding_range_registration_options.rb +27 -2
- 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/hover_options.rb +6 -1
- data/lib/language_server/protocol/interface/hover_params.rb +28 -2
- data/lib/language_server/protocol/interface/hover_registration_options.rb +17 -2
- data/lib/language_server/protocol/interface/implementation_client_capabilities.rb +3 -3
- data/lib/language_server/protocol/interface/implementation_options.rb +6 -1
- data/lib/language_server/protocol/interface/implementation_params.rb +38 -2
- data/lib/language_server/protocol/interface/implementation_registration_options.rb +27 -2
- data/lib/language_server/protocol/interface/initialize_params.rb +29 -6
- 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 +30 -0
- data/lib/language_server/protocol/interface/linked_editing_range_params.rb +51 -0
- data/lib/language_server/protocol/interface/linked_editing_range_registration_options.rb +50 -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 +30 -0
- data/lib/language_server/protocol/interface/moniker_params.rb +61 -0
- data/lib/language_server/protocol/interface/moniker_registration_options.rb +40 -0
- data/lib/language_server/protocol/interface/notification_message.rb +6 -1
- data/lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb +50 -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/prepare_rename_params.rb +17 -1
- 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/reference_options.rb +6 -1
- data/lib/language_server/protocol/interface/reference_params.rb +38 -2
- data/lib/language_server/protocol/interface/reference_registration_options.rb +17 -2
- 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/rename_options.rb +6 -1
- data/lib/language_server/protocol/interface/rename_params.rb +28 -2
- data/lib/language_server/protocol/interface/rename_registration_options.rb +25 -2
- data/lib/language_server/protocol/interface/request_message.rb +6 -1
- data/lib/language_server/protocol/interface/response_message.rb +6 -1
- 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/selection_range_options.rb +6 -1
- data/lib/language_server/protocol/interface/selection_range_params.rb +20 -2
- data/lib/language_server/protocol/interface/selection_range_registration_options.rb +27 -2
- 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 +62 -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 +58 -0
- data/lib/language_server/protocol/interface/semantic_tokens_params.rb +52 -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 +61 -0
- data/lib/language_server/protocol/interface/semantic_tokens_registration_options.rb +78 -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 +9 -3
- data/lib/language_server/protocol/interface/signature_help_params.rb +31 -4
- data/lib/language_server/protocol/interface/signature_help_registration_options.rb +38 -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 +11 -2
- 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_save_registration_options.rb +10 -1
- 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/type_definition_options.rb +6 -1
- data/lib/language_server/protocol/interface/type_definition_params.rb +38 -2
- data/lib/language_server/protocol/interface/type_definition_registration_options.rb +27 -2
- data/lib/language_server/protocol/interface/versioned_text_document_identifier.rb +12 -8
- 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/interface/workspace_symbol_options.rb +6 -1
- data/lib/language_server/protocol/interface/workspace_symbol_params.rb +20 -2
- data/lib/language_server/protocol/interface/workspace_symbol_registration_options.rb +6 -1
- data/lib/language_server/protocol/interface.rb +112 -0
- data/lib/language_server/protocol/transport/io/reader.rb +8 -24
- data/lib/language_server/protocol/transport/io/writer.rb +1 -0
- data/lib/language_server/protocol/version.rb +1 -1
- metadata +68 -21
@@ -1,16 +1,34 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class CodeLensParams
|
5
|
-
def initialize(partial_result_token: nil, text_document:)
|
4
|
+
class CodeLensParams
|
5
|
+
def initialize(work_done_token: nil, partial_result_token: nil, text_document:)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:workDoneToken] = work_done_token if work_done_token
|
8
9
|
@attributes[:partialResultToken] = partial_result_token if partial_result_token
|
9
10
|
@attributes[:textDocument] = text_document
|
10
11
|
|
11
12
|
@attributes.freeze
|
12
13
|
end
|
13
14
|
|
15
|
+
#
|
16
|
+
# An optional token that a server can use to report work done progress.
|
17
|
+
#
|
18
|
+
# @return [ProgressToken]
|
19
|
+
def work_done_token
|
20
|
+
attributes.fetch(:workDoneToken)
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# An optional token that a server can use to report partial results (e.g.
|
25
|
+
# streaming) to the client.
|
26
|
+
#
|
27
|
+
# @return [ProgressToken]
|
28
|
+
def partial_result_token
|
29
|
+
attributes.fetch(:partialResultToken)
|
30
|
+
end
|
31
|
+
|
14
32
|
#
|
15
33
|
# The document to request code lens for.
|
16
34
|
#
|
@@ -1,16 +1,39 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class CodeLensRegistrationOptions
|
5
|
-
def initialize(work_done_progress: nil, resolve_provider: nil)
|
4
|
+
class CodeLensRegistrationOptions
|
5
|
+
def initialize(document_selector:, work_done_progress: nil, resolve_provider: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:documentSelector] = document_selector
|
8
9
|
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
9
10
|
@attributes[:resolveProvider] = resolve_provider if resolve_provider
|
10
11
|
|
11
12
|
@attributes.freeze
|
12
13
|
end
|
13
14
|
|
15
|
+
#
|
16
|
+
# A document selector to identify the scope of the registration. If set to
|
17
|
+
# null the document selector provided on the client side will be used.
|
18
|
+
#
|
19
|
+
# @return [DocumentSelector]
|
20
|
+
def document_selector
|
21
|
+
attributes.fetch(:documentSelector)
|
22
|
+
end
|
23
|
+
|
24
|
+
# @return [boolean]
|
25
|
+
def work_done_progress
|
26
|
+
attributes.fetch(:workDoneProgress)
|
27
|
+
end
|
28
|
+
|
29
|
+
#
|
30
|
+
# Code lens has a resolve provider as well.
|
31
|
+
#
|
32
|
+
# @return [boolean]
|
33
|
+
def resolve_provider
|
34
|
+
attributes.fetch(:resolveProvider)
|
35
|
+
end
|
36
|
+
|
14
37
|
attr_reader :attributes
|
15
38
|
|
16
39
|
def to_hash
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class CodeLensWorkspaceClientCapabilities
|
5
|
+
def initialize(refresh_support: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:refreshSupport] = refresh_support if refresh_support
|
9
|
+
|
10
|
+
@attributes.freeze
|
11
|
+
end
|
12
|
+
|
13
|
+
#
|
14
|
+
# Whether the client implementation supports a refresh request sent from the
|
15
|
+
# server to the client.
|
16
|
+
#
|
17
|
+
# Note that this event is global and will force the client to refresh all
|
18
|
+
# code lenses currently shown. It should be used with absolute care and is
|
19
|
+
# useful for situation where a server for example detect a project wide
|
20
|
+
# change that requires such a calculation.
|
21
|
+
#
|
22
|
+
# @return [boolean]
|
23
|
+
def refresh_support
|
24
|
+
attributes.fetch(:refreshSupport)
|
25
|
+
end
|
26
|
+
|
27
|
+
attr_reader :attributes
|
28
|
+
|
29
|
+
def to_hash
|
30
|
+
attributes
|
31
|
+
end
|
32
|
+
|
33
|
+
def to_json(*args)
|
34
|
+
to_hash.to_json(*args)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -14,8 +14,8 @@ module LanguageServer
|
|
14
14
|
|
15
15
|
#
|
16
16
|
# The label of this color presentation. It will be shown on the color
|
17
|
-
# picker header. By default this is also the text that is inserted when
|
18
|
-
# this color presentation.
|
17
|
+
# picker header. By default this is also the text that is inserted when
|
18
|
+
# selecting this color presentation.
|
19
19
|
#
|
20
20
|
# @return [string]
|
21
21
|
def label
|
@@ -24,8 +24,8 @@ module LanguageServer
|
|
24
24
|
|
25
25
|
#
|
26
26
|
# An [edit](#TextEdit) which is applied to a document when selecting
|
27
|
-
# this presentation for the color. When `falsy` the
|
28
|
-
# is used.
|
27
|
+
# this presentation for the color. When `falsy` the
|
28
|
+
# [label](#ColorPresentation.label) is used.
|
29
29
|
#
|
30
30
|
# @return [TextEdit]
|
31
31
|
def text_edit
|
@@ -33,8 +33,9 @@ module LanguageServer
|
|
33
33
|
end
|
34
34
|
|
35
35
|
#
|
36
|
-
# An optional array of additional [text edits](#TextEdit) that are applied
|
37
|
-
# selecting this color presentation. Edits must not overlap with the
|
36
|
+
# An optional array of additional [text edits](#TextEdit) that are applied
|
37
|
+
# when selecting this color presentation. Edits must not overlap with the
|
38
|
+
# main [edit](#ColorPresentation.textEdit) nor with themselves.
|
38
39
|
#
|
39
40
|
# @return [TextEdit[]]
|
40
41
|
def additional_text_edits
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class ColorPresentationParams
|
5
|
-
def initialize(partial_result_token: nil, text_document:, color:, range:)
|
4
|
+
class ColorPresentationParams
|
5
|
+
def initialize(work_done_token: nil, partial_result_token: nil, text_document:, color:, range:)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:workDoneToken] = work_done_token if work_done_token
|
8
9
|
@attributes[:partialResultToken] = partial_result_token if partial_result_token
|
9
10
|
@attributes[:textDocument] = text_document
|
10
11
|
@attributes[:color] = color
|
@@ -13,6 +14,23 @@ module LanguageServer
|
|
13
14
|
@attributes.freeze
|
14
15
|
end
|
15
16
|
|
17
|
+
#
|
18
|
+
# An optional token that a server can use to report work done progress.
|
19
|
+
#
|
20
|
+
# @return [ProgressToken]
|
21
|
+
def work_done_token
|
22
|
+
attributes.fetch(:workDoneToken)
|
23
|
+
end
|
24
|
+
|
25
|
+
#
|
26
|
+
# An optional token that a server can use to report partial results (e.g.
|
27
|
+
# streaming) to the client.
|
28
|
+
#
|
29
|
+
# @return [ProgressToken]
|
30
|
+
def partial_result_token
|
31
|
+
attributes.fetch(:partialResultToken)
|
32
|
+
end
|
33
|
+
|
16
34
|
#
|
17
35
|
# The text document.
|
18
36
|
#
|
@@ -25,7 +25,7 @@ module LanguageServer
|
|
25
25
|
# The client supports the following `CompletionItem` specific
|
26
26
|
# capabilities.
|
27
27
|
#
|
28
|
-
# @return [{ snippetSupport?: boolean; commitCharactersSupport?: boolean; documentationFormat?: MarkupKind[]
|
28
|
+
# @return [{ snippetSupport?: boolean; commitCharactersSupport?: boolean; documentationFormat?: MarkupKind[]; deprecatedSupport?: boolean; preselectSupport?: boolean; tagSupport?: { valueSet: 1[]; }; insertReplaceSupport?: boolean; resolveSupport?: { ...; }; insertTextModeSupport?: { ...; }; }]
|
29
29
|
def completion_item
|
30
30
|
attributes.fetch(:completionItem)
|
31
31
|
end
|
@@ -2,7 +2,8 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
#
|
5
|
-
# Contains additional information about the context in which a completion
|
5
|
+
# Contains additional information about the context in which a completion
|
6
|
+
# request is triggered.
|
6
7
|
#
|
7
8
|
class CompletionContext
|
8
9
|
def initialize(trigger_kind:, trigger_character: nil)
|
@@ -23,8 +24,9 @@ module LanguageServer
|
|
23
24
|
end
|
24
25
|
|
25
26
|
#
|
26
|
-
# The trigger character (a single character) that has trigger code
|
27
|
-
# Is undefined if
|
27
|
+
# The trigger character (a single character) that has trigger code
|
28
|
+
# complete. Is undefined if
|
29
|
+
# `triggerKind !== CompletionTriggerKind.TriggerCharacter`
|
28
30
|
#
|
29
31
|
# @return [string]
|
30
32
|
def trigger_character
|
@@ -2,7 +2,7 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
class CompletionItem
|
5
|
-
def initialize(label:, kind: nil, tags: nil, detail: nil, documentation: nil, deprecated: nil, preselect: nil, sort_text: nil, filter_text: nil, insert_text: nil, insert_text_format: nil, text_edit: nil, additional_text_edits: nil, commit_characters: nil, command: nil, data: nil)
|
5
|
+
def initialize(label:, kind: nil, tags: nil, detail: nil, documentation: nil, deprecated: nil, preselect: nil, sort_text: nil, filter_text: nil, insert_text: nil, insert_text_format: nil, insert_text_mode: nil, text_edit: nil, additional_text_edits: nil, commit_characters: nil, command: nil, data: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
8
|
@attributes[:label] = label
|
@@ -16,6 +16,7 @@ module LanguageServer
|
|
16
16
|
@attributes[:filterText] = filter_text if filter_text
|
17
17
|
@attributes[:insertText] = insert_text if insert_text
|
18
18
|
@attributes[:insertTextFormat] = insert_text_format if insert_text_format
|
19
|
+
@attributes[:insertTextMode] = insert_text_mode if insert_text_mode
|
19
20
|
@attributes[:textEdit] = text_edit if text_edit
|
20
21
|
@attributes[:additionalTextEdits] = additional_text_edits if additional_text_edits
|
21
22
|
@attributes[:commitCharacters] = commit_characters if commit_characters
|
@@ -40,7 +41,7 @@ module LanguageServer
|
|
40
41
|
# an icon is chosen by the editor. The standardized set
|
41
42
|
# of available values is defined in `CompletionItemKind`.
|
42
43
|
#
|
43
|
-
# @return [
|
44
|
+
# @return [any]
|
44
45
|
def kind
|
45
46
|
attributes.fetch(:kind)
|
46
47
|
end
|
@@ -92,7 +93,8 @@ module LanguageServer
|
|
92
93
|
|
93
94
|
#
|
94
95
|
# A string that should be used when comparing this item
|
95
|
-
# with other items. When `falsy` the label is used
|
96
|
+
# with other items. When `falsy` the label is used
|
97
|
+
# as the sort text for this item.
|
96
98
|
#
|
97
99
|
# @return [string]
|
98
100
|
def sort_text
|
@@ -101,7 +103,8 @@ module LanguageServer
|
|
101
103
|
|
102
104
|
#
|
103
105
|
# A string that should be used when filtering a set of
|
104
|
-
# completion items. When `falsy` the label is used
|
106
|
+
# completion items. When `falsy` the label is used as the
|
107
|
+
# filter text for this item.
|
105
108
|
#
|
106
109
|
# @return [string]
|
107
110
|
def filter_text
|
@@ -110,14 +113,16 @@ module LanguageServer
|
|
110
113
|
|
111
114
|
#
|
112
115
|
# A string that should be inserted into a document when selecting
|
113
|
-
# this completion. When `falsy` the label is used
|
116
|
+
# this completion. When `falsy` the label is used as the insert text
|
117
|
+
# for this item.
|
114
118
|
#
|
115
119
|
# The `insertText` is subject to interpretation by the client side.
|
116
120
|
# Some tools might not take the string literally. For example
|
117
|
-
# VS Code when code complete is requested in this example
|
118
|
-
# and a completion item with an `insertText` of
|
119
|
-
# will only insert `sole`. Therefore it is
|
120
|
-
# since it avoids additional client
|
121
|
+
# VS Code when code complete is requested in this example
|
122
|
+
# `con<cursor position>` and a completion item with an `insertText` of
|
123
|
+
# `console` is provided it will only insert `sole`. Therefore it is
|
124
|
+
# recommended to use `textEdit` instead since it avoids additional client
|
125
|
+
# side interpretation.
|
121
126
|
#
|
122
127
|
# @return [string]
|
123
128
|
def insert_text
|
@@ -125,35 +130,60 @@ module LanguageServer
|
|
125
130
|
end
|
126
131
|
|
127
132
|
#
|
128
|
-
# The format of the insert text. The format applies to both the
|
129
|
-
# and the `newText` property of a provided
|
130
|
-
# `InsertTextFormat.PlainText`.
|
133
|
+
# The format of the insert text. The format applies to both the
|
134
|
+
# `insertText` property and the `newText` property of a provided
|
135
|
+
# `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.
|
131
136
|
#
|
132
|
-
# @return [
|
137
|
+
# @return [InsertTextFormat]
|
133
138
|
def insert_text_format
|
134
139
|
attributes.fetch(:insertTextFormat)
|
135
140
|
end
|
136
141
|
|
137
142
|
#
|
138
|
-
#
|
139
|
-
#
|
143
|
+
# How whitespace and indentation is handled during completion
|
144
|
+
# item insertion. If not provided the client's default value depends on
|
145
|
+
# the `textDocument.completion.insertTextMode` client capability.
|
146
|
+
#
|
147
|
+
# @return [InsertTextMode]
|
148
|
+
def insert_text_mode
|
149
|
+
attributes.fetch(:insertTextMode)
|
150
|
+
end
|
151
|
+
|
152
|
+
#
|
153
|
+
# An edit which is applied to a document when selecting this completion.
|
154
|
+
# When an edit is provided the value of `insertText` is ignored.
|
155
|
+
#
|
156
|
+
# *Note:* The range of the edit must be a single line range and it must
|
157
|
+
# contain the position at which completion has been requested.
|
158
|
+
#
|
159
|
+
# Most editors support two different operations when accepting a completion
|
160
|
+
# item. One is to insert a completion text and the other is to replace an
|
161
|
+
# existing text with a completion text. Since this can usually not be
|
162
|
+
# predetermined by a server it can report both ranges. Clients need to
|
163
|
+
# signal support for `InsertReplaceEdits` via the
|
164
|
+
# `textDocument.completion.insertReplaceSupport` client capability
|
165
|
+
# property.
|
140
166
|
#
|
141
|
-
# *Note:* The
|
142
|
-
#
|
167
|
+
# *Note 1:* The text edit's range as well as both ranges from an insert
|
168
|
+
# replace edit must be a [single line] and they must contain the position
|
169
|
+
# at which completion has been requested.
|
170
|
+
# *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range
|
171
|
+
# must be a prefix of the edit's replace range, that means it must be
|
172
|
+
# contained and starting at the same position.
|
143
173
|
#
|
144
|
-
# @return [TextEdit]
|
174
|
+
# @return [TextEdit | InsertReplaceEdit]
|
145
175
|
def text_edit
|
146
176
|
attributes.fetch(:textEdit)
|
147
177
|
end
|
148
178
|
|
149
179
|
#
|
150
180
|
# An optional array of additional text edits that are applied when
|
151
|
-
# selecting this completion. Edits must not overlap (including the same
|
152
|
-
# with the main edit nor with themselves.
|
181
|
+
# selecting this completion. Edits must not overlap (including the same
|
182
|
+
# insert position) with the main edit nor with themselves.
|
153
183
|
#
|
154
|
-
# Additional text edits should be used to change text unrelated to the
|
155
|
-
# (for example adding an import statement at the
|
156
|
-
# insert an unqualified type).
|
184
|
+
# Additional text edits should be used to change text unrelated to the
|
185
|
+
# current cursor position (for example adding an import statement at the
|
186
|
+
# top of the file if the completion item will insert an unqualified type).
|
157
187
|
#
|
158
188
|
# @return [TextEdit[]]
|
159
189
|
def additional_text_edits
|
@@ -161,9 +191,10 @@ module LanguageServer
|
|
161
191
|
end
|
162
192
|
|
163
193
|
#
|
164
|
-
# An optional set of characters that when pressed while this completion is
|
165
|
-
# then type that character. *Note* that all
|
166
|
-
# characters
|
194
|
+
# An optional set of characters that when pressed while this completion is
|
195
|
+
# active will accept it first and then type that character. *Note* that all
|
196
|
+
# commit characters should have `length=1` and that superfluous characters
|
197
|
+
# will be ignored.
|
167
198
|
#
|
168
199
|
# @return [string[]]
|
169
200
|
def commit_characters
|
@@ -171,9 +202,9 @@ module LanguageServer
|
|
171
202
|
end
|
172
203
|
|
173
204
|
#
|
174
|
-
# An optional command that is executed *after* inserting this completion.
|
175
|
-
# additional modifications to the current document should be
|
176
|
-
# additionalTextEdits-property.
|
205
|
+
# An optional command that is executed *after* inserting this completion.
|
206
|
+
# *Note* that additional modifications to the current document should be
|
207
|
+
# described with the additionalTextEdits-property.
|
177
208
|
#
|
178
209
|
# @return [Command]
|
179
210
|
def command
|
@@ -2,8 +2,8 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
#
|
5
|
-
# Represents a collection of [completion items](#CompletionItem) to be
|
6
|
-
# in the editor.
|
5
|
+
# Represents a collection of [completion items](#CompletionItem) to be
|
6
|
+
# presented in the editor.
|
7
7
|
#
|
8
8
|
class CompletionList
|
9
9
|
def initialize(is_incomplete:, items:)
|
@@ -4,7 +4,7 @@ module LanguageServer
|
|
4
4
|
#
|
5
5
|
# Completion options.
|
6
6
|
#
|
7
|
-
class CompletionOptions
|
7
|
+
class CompletionOptions
|
8
8
|
def initialize(work_done_progress: nil, trigger_characters: nil, all_commit_characters: nil, resolve_provider: nil)
|
9
9
|
@attributes = {}
|
10
10
|
|
@@ -16,15 +16,22 @@ module LanguageServer
|
|
16
16
|
@attributes.freeze
|
17
17
|
end
|
18
18
|
|
19
|
+
# @return [boolean]
|
20
|
+
def work_done_progress
|
21
|
+
attributes.fetch(:workDoneProgress)
|
22
|
+
end
|
23
|
+
|
19
24
|
#
|
20
|
-
# Most tools trigger completion request automatically without explicitly
|
21
|
-
# it using a keyboard shortcut (e.g. Ctrl+Space). Typically they
|
22
|
-
# starts to type an identifier. For example if the user
|
23
|
-
# code complete will automatically pop up
|
24
|
-
#
|
25
|
+
# Most tools trigger completion request automatically without explicitly
|
26
|
+
# requesting it using a keyboard shortcut (e.g. Ctrl+Space). Typically they
|
27
|
+
# do so when the user starts to type an identifier. For example if the user
|
28
|
+
# types `c` in a JavaScript file code complete will automatically pop up
|
29
|
+
# present `console` besides others as a completion item. Characters that
|
30
|
+
# make up identifiers don't need to be listed here.
|
25
31
|
#
|
26
|
-
# If code complete should automatically be trigger on characters not being
|
27
|
-
# an identifier (for example `.` in JavaScript) list them in
|
32
|
+
# If code complete should automatically be trigger on characters not being
|
33
|
+
# valid inside an identifier (for example `.` in JavaScript) list them in
|
34
|
+
# `triggerCharacters`.
|
28
35
|
#
|
29
36
|
# @return [string[]]
|
30
37
|
def trigger_characters
|
@@ -32,12 +39,13 @@ module LanguageServer
|
|
32
39
|
end
|
33
40
|
|
34
41
|
#
|
35
|
-
# The list of all possible characters that commit a completion. This field
|
36
|
-
# if clients don't support individual commit characters per
|
37
|
-
#
|
42
|
+
# The list of all possible characters that commit a completion. This field
|
43
|
+
# can be used if clients don't support individual commit characters per
|
44
|
+
# completion item. See client capability
|
45
|
+
# `completion.completionItem.commitCharactersSupport`.
|
38
46
|
#
|
39
|
-
# If a server provides both `allCommitCharacters` and commit characters on
|
40
|
-
# completion item the ones on the completion item win.
|
47
|
+
# If a server provides both `allCommitCharacters` and commit characters on
|
48
|
+
# an individual completion item the ones on the completion item win.
|
41
49
|
#
|
42
50
|
# @return [string[]]
|
43
51
|
def all_commit_characters
|