language_server-protocol 3.14.0.1 → 3.16.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -2
- data/lib/language_server/protocol/constant.rb +18 -0
- data/lib/language_server/protocol/constant/code_action_kind.rb +17 -11
- data/lib/language_server/protocol/constant/completion_item_tag.rb +16 -0
- data/lib/language_server/protocol/constant/completion_trigger_kind.rb +2 -1
- data/lib/language_server/protocol/constant/diagnostic_tag.rb +24 -0
- 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 +24 -0
- 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 -1
- data/lib/language_server/protocol/constant/token_format.rb +9 -0
- data/lib/language_server/protocol/interface.rb +270 -6
- data/lib/language_server/protocol/interface/annotated_text_edit.rb +38 -0
- data/lib/language_server/protocol/interface/apply_workspace_edit_response.rb +24 -1
- 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 +20 -2
- data/lib/language_server/protocol/interface/code_action.rb +52 -4
- data/lib/language_server/protocol/interface/code_action_client_capabilities.rb +95 -0
- data/lib/language_server/protocol/interface/code_action_context.rb +8 -3
- data/lib/language_server/protocol/interface/code_action_options.rb +15 -7
- data/lib/language_server/protocol/interface/code_action_params.rb +3 -2
- data/lib/language_server/protocol/interface/code_action_registration_options.rb +4 -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_client_capabilities.rb +33 -0
- data/lib/language_server/protocol/interface/code_lens_options.rb +3 -5
- data/lib/language_server/protocol/interface/code_lens_params.rb +3 -2
- data/lib/language_server/protocol/interface/code_lens_registration_options.rb +3 -10
- 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 +3 -2
- data/lib/language_server/protocol/interface/completion_client_capabilities.rb +59 -0
- data/lib/language_server/protocol/interface/completion_context.rb +5 -3
- data/lib/language_server/protocol/interface/completion_item.rb +71 -29
- data/lib/language_server/protocol/interface/completion_list.rb +2 -2
- data/lib/language_server/protocol/interface/completion_options.rb +36 -11
- data/lib/language_server/protocol/interface/completion_params.rb +5 -3
- data/lib/language_server/protocol/interface/completion_registration_options.rb +4 -26
- 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 +44 -0
- data/lib/language_server/protocol/interface/declaration_options.rb +25 -0
- data/lib/language_server/protocol/interface/declaration_params.rb +25 -0
- data/lib/language_server/protocol/interface/{folding_range_provider_options.rb → declaration_registration_options.rb} +3 -5
- data/lib/language_server/protocol/interface/definition_client_capabilities.rb +42 -0
- data/lib/language_server/protocol/interface/definition_options.rb +25 -0
- data/lib/language_server/protocol/interface/definition_params.rb +25 -0
- data/lib/language_server/protocol/interface/definition_registration_options.rb +25 -0
- 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 +31 -2
- data/lib/language_server/protocol/interface/diagnostic_related_information.rb +3 -3
- data/lib/language_server/protocol/interface/did_change_configuration_client_capabilities.rb +33 -0
- data/lib/language_server/protocol/interface/did_change_text_document_params.rb +13 -3
- data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +35 -0
- data/lib/language_server/protocol/interface/did_change_watched_files_registration_options.rb +1 -1
- data/lib/language_server/protocol/interface/document_color_client_capabilities.rb +33 -0
- data/lib/language_server/protocol/interface/document_color_options.rb +25 -0
- data/lib/language_server/protocol/interface/document_color_params.rb +34 -0
- data/lib/language_server/protocol/interface/document_color_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/document_filter.rb +7 -3
- data/lib/language_server/protocol/interface/document_formatting_client_capabilities.rb +33 -0
- data/lib/language_server/protocol/interface/document_formatting_options.rb +25 -0
- data/lib/language_server/protocol/interface/document_formatting_params.rb +3 -2
- data/lib/language_server/protocol/interface/document_formatting_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/document_highlight.rb +1 -1
- data/lib/language_server/protocol/interface/document_highlight_client_capabilities.rb +33 -0
- data/lib/language_server/protocol/interface/document_highlight_options.rb +25 -0
- data/lib/language_server/protocol/interface/document_highlight_params.rb +25 -0
- data/lib/language_server/protocol/interface/document_highlight_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/document_link.rb +17 -3
- data/lib/language_server/protocol/interface/document_link_client_capabilities.rb +42 -0
- data/lib/language_server/protocol/interface/document_link_options.rb +3 -5
- data/lib/language_server/protocol/interface/document_link_params.rb +3 -2
- data/lib/language_server/protocol/interface/document_link_registration_options.rb +3 -10
- data/lib/language_server/protocol/interface/document_on_type_formatting_client_capabilities.rb +33 -0
- data/lib/language_server/protocol/interface/document_on_type_formatting_options.rb +0 -3
- data/lib/language_server/protocol/interface/document_on_type_formatting_params.rb +1 -17
- data/lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb +2 -18
- data/lib/language_server/protocol/interface/document_range_formatting_client_capabilities.rb +33 -0
- data/lib/language_server/protocol/interface/document_range_formatting_options.rb +25 -0
- data/lib/language_server/protocol/interface/document_range_formatting_params.rb +3 -2
- data/lib/language_server/protocol/interface/document_range_formatting_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/document_symbol.rb +108 -0
- data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +73 -0
- data/lib/language_server/protocol/interface/document_symbol_options.rb +35 -0
- data/lib/language_server/protocol/interface/document_symbol_params.rb +3 -2
- data/lib/language_server/protocol/interface/document_symbol_registration_options.rb +26 -0
- data/lib/language_server/protocol/interface/execute_command_client_capabilities.rb +33 -0
- data/lib/language_server/protocol/interface/execute_command_options.rb +3 -5
- data/lib/language_server/protocol/interface/execute_command_params.rb +3 -2
- data/lib/language_server/protocol/interface/execute_command_registration_options.rb +3 -10
- 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 +58 -0
- data/lib/language_server/protocol/interface/folding_range_options.rb +25 -0
- data/lib/language_server/protocol/interface/folding_range_params.rb +3 -2
- data/lib/language_server/protocol/interface/{color_provider_options.rb → folding_range_registration_options.rb} +3 -5
- data/lib/language_server/protocol/interface/formatting_options.rb +28 -1
- data/lib/language_server/protocol/interface/hover.rb +1 -1
- data/lib/language_server/protocol/interface/hover_client_capabilities.rb +44 -0
- data/lib/language_server/protocol/interface/hover_options.rb +25 -0
- data/lib/language_server/protocol/interface/hover_params.rb +25 -0
- data/lib/language_server/protocol/interface/hover_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/implementation_client_capabilities.rb +44 -0
- data/lib/language_server/protocol/interface/implementation_options.rb +25 -0
- data/lib/language_server/protocol/interface/implementation_params.rb +25 -0
- data/lib/language_server/protocol/interface/implementation_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/initialize_params.rb +31 -8
- data/lib/language_server/protocol/interface/initialize_result.rb +10 -1
- 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 +11 -6
- 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/notification_message.rb +2 -1
- 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 +34 -0
- data/lib/language_server/protocol/interface/position.rb +5 -5
- data/lib/language_server/protocol/interface/prepare_rename_params.rb +26 -0
- data/lib/language_server/protocol/interface/progress_params.rb +42 -0
- data/lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb +73 -0
- data/lib/language_server/protocol/interface/publish_diagnostics_params.rb +11 -1
- data/lib/language_server/protocol/interface/reference_client_capabilities.rb +33 -0
- data/lib/language_server/protocol/interface/reference_options.rb +25 -0
- data/lib/language_server/protocol/interface/reference_params.rb +3 -2
- data/lib/language_server/protocol/interface/reference_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/regular_expressions_client_capabilities.rb +45 -0
- data/lib/language_server/protocol/interface/rename_client_capabilities.rb +69 -0
- 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 +3 -5
- data/lib/language_server/protocol/interface/rename_params.rb +3 -20
- data/lib/language_server/protocol/interface/rename_registration_options.rb +3 -10
- data/lib/language_server/protocol/interface/request_message.rb +2 -1
- data/lib/language_server/protocol/interface/response_error.rb +2 -2
- data/lib/language_server/protocol/interface/response_message.rb +5 -4
- data/lib/language_server/protocol/interface/save_options.rb +0 -3
- data/lib/language_server/protocol/interface/selection_range.rb +43 -0
- data/lib/language_server/protocol/interface/selection_range_client_capabilities.rb +36 -0
- data/lib/language_server/protocol/interface/selection_range_options.rb +25 -0
- data/lib/language_server/protocol/interface/selection_range_params.rb +43 -0
- data/lib/language_server/protocol/interface/selection_range_registration_options.rb +25 -0
- 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 +108 -60
- 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 +7 -4
- data/lib/language_server/protocol/interface/signature_help_client_capabilities.rb +55 -0
- data/lib/language_server/protocol/interface/signature_help_context.rb +74 -0
- data/lib/language_server/protocol/interface/signature_help_options.rb +16 -5
- data/lib/language_server/protocol/interface/signature_help_params.rb +36 -0
- data/lib/language_server/protocol/interface/signature_help_registration_options.rb +4 -11
- data/lib/language_server/protocol/interface/signature_information.rb +12 -1
- data/lib/language_server/protocol/interface/symbol_information.rb +11 -2
- data/lib/language_server/protocol/interface/text_document_change_registration_options.rb +2 -1
- data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +123 -86
- data/lib/language_server/protocol/interface/text_document_content_change_event.rb +10 -6
- data/lib/language_server/protocol/interface/text_document_edit.rb +2 -2
- data/lib/language_server/protocol/interface/text_document_registration_options.rb +6 -3
- data/lib/language_server/protocol/interface/text_document_save_registration_options.rb +1 -0
- data/lib/language_server/protocol/interface/text_document_sync_client_capabilities.rb +62 -0
- data/lib/language_server/protocol/interface/text_document_sync_options.rb +14 -8
- data/lib/language_server/protocol/interface/type_definition_client_capabilities.rb +44 -0
- data/lib/language_server/protocol/interface/type_definition_options.rb +25 -0
- data/lib/language_server/protocol/interface/type_definition_params.rb +25 -0
- data/lib/language_server/protocol/interface/type_definition_registration_options.rb +25 -0
- data/lib/language_server/protocol/interface/versioned_text_document_identifier.rb +4 -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 +80 -0
- data/lib/language_server/protocol/interface/work_done_progress_cancel_params.rb +33 -0
- data/lib/language_server/protocol/interface/work_done_progress_create_params.rb +33 -0
- data/lib/language_server/protocol/interface/work_done_progress_end.rb +40 -0
- data/lib/language_server/protocol/interface/work_done_progress_options.rb +30 -0
- data/lib/language_server/protocol/interface/work_done_progress_params.rb +33 -0
- data/lib/language_server/protocol/interface/work_done_progress_report.rb +70 -0
- data/lib/language_server/protocol/interface/workspace_edit.rb +25 -8
- data/lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb +75 -0
- data/lib/language_server/protocol/interface/workspace_folder.rb +2 -2
- data/lib/language_server/protocol/interface/workspace_folders_server_capabilities.rb +48 -0
- data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +53 -0
- data/lib/language_server/protocol/interface/workspace_symbol_options.rb +25 -0
- data/lib/language_server/protocol/interface/workspace_symbol_params.rb +5 -3
- data/lib/language_server/protocol/interface/workspace_symbol_registration_options.rb +25 -0
- data/lib/language_server/protocol/transport/io/reader.rb +1 -1
- data/lib/language_server/protocol/version.rb +1 -1
- metadata +154 -35
- data/.gitignore +0 -10
- data/.travis.yml +0 -5
- data/CHANGELOG.md +0 -26
- data/CODE_OF_CONDUCT.md +0 -74
- data/Dockerfile-node.development +0 -6
- data/Dockerfile.development +0 -24
- data/Gemfile +0 -6
- data/Rakefile +0 -10
- data/bin/console +0 -14
- data/bin/generate_files +0 -5
- data/bin/m +0 -17
- data/bin/setup +0 -6
- data/circle.yml +0 -40
- data/docker-compose.ci.yml +0 -14
- data/docker-compose.override.yml +0 -16
- data/docker-compose.yml +0 -33
- data/language_server-protocol.gemspec +0 -33
- data/lib/language_server/protocol/interface/workspace_client_capabilities.rb +0 -104
- data/package.json +0 -10
- data/scripts/generateFiles.ts +0 -320
- data/yarn.lock +0 -293
@@ -0,0 +1,33 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class CodeLensClientCapabilities
|
5
|
+
def initialize(dynamic_registration: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
|
9
|
+
|
10
|
+
@attributes.freeze
|
11
|
+
end
|
12
|
+
|
13
|
+
#
|
14
|
+
# Whether code lens supports dynamic registration.
|
15
|
+
#
|
16
|
+
# @return [boolean]
|
17
|
+
def dynamic_registration
|
18
|
+
attributes.fetch(:dynamicRegistration)
|
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
|
@@ -1,13 +1,11 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
|
5
|
-
|
6
|
-
#
|
7
|
-
class CodeLensOptions
|
8
|
-
def initialize(resolve_provider: nil)
|
4
|
+
class CodeLensOptions < WorkDoneProgressOptions
|
5
|
+
def initialize(work_done_progress: nil, resolve_provider: nil)
|
9
6
|
@attributes = {}
|
10
7
|
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
11
9
|
@attributes[:resolveProvider] = resolve_provider if resolve_provider
|
12
10
|
|
13
11
|
@attributes.freeze
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class CodeLensParams
|
5
|
-
def initialize(text_document:)
|
4
|
+
class CodeLensParams < PartialResultParams
|
5
|
+
def initialize(partial_result_token: nil, text_document:)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:partialResultToken] = partial_result_token if partial_result_token
|
8
9
|
@attributes[:textDocument] = text_document
|
9
10
|
|
10
11
|
@attributes.freeze
|
@@ -1,23 +1,16 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class CodeLensRegistrationOptions <
|
5
|
-
def initialize(
|
4
|
+
class CodeLensRegistrationOptions < CodeLensOptions
|
5
|
+
def initialize(work_done_progress: nil, resolve_provider: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
8
9
|
@attributes[:resolveProvider] = resolve_provider if resolve_provider
|
9
10
|
|
10
11
|
@attributes.freeze
|
11
12
|
end
|
12
13
|
|
13
|
-
#
|
14
|
-
# Code lens has a resolve provider as well.
|
15
|
-
#
|
16
|
-
# @return [boolean]
|
17
|
-
def resolve_provider
|
18
|
-
attributes.fetch(:resolveProvider)
|
19
|
-
end
|
20
|
-
|
21
14
|
attr_reader :attributes
|
22
15
|
|
23
16
|
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(text_document:, color:, range:)
|
4
|
+
class ColorPresentationParams < PartialResultParams
|
5
|
+
def initialize(partial_result_token: nil, text_document:, color:, range:)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:partialResultToken] = partial_result_token if partial_result_token
|
8
9
|
@attributes[:textDocument] = text_document
|
9
10
|
@attributes[:color] = color
|
10
11
|
@attributes[:range] = range
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class CompletionClientCapabilities
|
5
|
+
def initialize(dynamic_registration: nil, completion_item: nil, completion_item_kind: nil, context_support: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
|
9
|
+
@attributes[:completionItem] = completion_item if completion_item
|
10
|
+
@attributes[:completionItemKind] = completion_item_kind if completion_item_kind
|
11
|
+
@attributes[:contextSupport] = context_support if context_support
|
12
|
+
|
13
|
+
@attributes.freeze
|
14
|
+
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# Whether completion supports dynamic registration.
|
18
|
+
#
|
19
|
+
# @return [boolean]
|
20
|
+
def dynamic_registration
|
21
|
+
attributes.fetch(:dynamicRegistration)
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# The client supports the following `CompletionItem` specific
|
26
|
+
# capabilities.
|
27
|
+
#
|
28
|
+
# @return [{ snippetSupport?: boolean; commitCharactersSupport?: boolean; documentationFormat?: MarkupKind[]; deprecatedSupport?: boolean; preselectSupport?: boolean; tagSupport?: { valueSet: 1[]; }; insertReplaceSupport?: boolean; resolveSupport?: { ...; }; insertTextModeSupport?: { ...; }; }]
|
29
|
+
def completion_item
|
30
|
+
attributes.fetch(:completionItem)
|
31
|
+
end
|
32
|
+
|
33
|
+
# @return [{ valueSet?: any[]; }]
|
34
|
+
def completion_item_kind
|
35
|
+
attributes.fetch(:completionItemKind)
|
36
|
+
end
|
37
|
+
|
38
|
+
#
|
39
|
+
# The client supports to send additional context information for a
|
40
|
+
# `textDocument/completion` request.
|
41
|
+
#
|
42
|
+
# @return [boolean]
|
43
|
+
def context_support
|
44
|
+
attributes.fetch(:contextSupport)
|
45
|
+
end
|
46
|
+
|
47
|
+
attr_reader :attributes
|
48
|
+
|
49
|
+
def to_hash
|
50
|
+
attributes
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_json(*args)
|
54
|
+
to_hash.to_json(*args)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
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,11 +2,12 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
class CompletionItem
|
5
|
-
def initialize(label:, kind: 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
|
9
9
|
@attributes[:kind] = kind if kind
|
10
|
+
@attributes[:tags] = tags if tags
|
10
11
|
@attributes[:detail] = detail if detail
|
11
12
|
@attributes[:documentation] = documentation if documentation
|
12
13
|
@attributes[:deprecated] = deprecated if deprecated
|
@@ -15,6 +16,7 @@ module LanguageServer
|
|
15
16
|
@attributes[:filterText] = filter_text if filter_text
|
16
17
|
@attributes[:insertText] = insert_text if insert_text
|
17
18
|
@attributes[:insertTextFormat] = insert_text_format if insert_text_format
|
19
|
+
@attributes[:insertTextMode] = insert_text_mode if insert_text_mode
|
18
20
|
@attributes[:textEdit] = text_edit if text_edit
|
19
21
|
@attributes[:additionalTextEdits] = additional_text_edits if additional_text_edits
|
20
22
|
@attributes[:commitCharacters] = commit_characters if commit_characters
|
@@ -36,13 +38,22 @@ module LanguageServer
|
|
36
38
|
|
37
39
|
#
|
38
40
|
# The kind of this completion item. Based of the kind
|
39
|
-
# an icon is chosen by the editor.
|
41
|
+
# an icon is chosen by the editor. The standardized set
|
42
|
+
# of available values is defined in `CompletionItemKind`.
|
40
43
|
#
|
41
|
-
# @return [
|
44
|
+
# @return [any]
|
42
45
|
def kind
|
43
46
|
attributes.fetch(:kind)
|
44
47
|
end
|
45
48
|
|
49
|
+
#
|
50
|
+
# Tags for this completion item.
|
51
|
+
#
|
52
|
+
# @return [1[]]
|
53
|
+
def tags
|
54
|
+
attributes.fetch(:tags)
|
55
|
+
end
|
56
|
+
|
46
57
|
#
|
47
58
|
# A human-readable string with additional information
|
48
59
|
# about this item, like type or symbol information.
|
@@ -82,7 +93,8 @@ module LanguageServer
|
|
82
93
|
|
83
94
|
#
|
84
95
|
# A string that should be used when comparing this item
|
85
|
-
# 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.
|
86
98
|
#
|
87
99
|
# @return [string]
|
88
100
|
def sort_text
|
@@ -91,7 +103,8 @@ module LanguageServer
|
|
91
103
|
|
92
104
|
#
|
93
105
|
# A string that should be used when filtering a set of
|
94
|
-
# 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.
|
95
108
|
#
|
96
109
|
# @return [string]
|
97
110
|
def filter_text
|
@@ -100,14 +113,16 @@ module LanguageServer
|
|
100
113
|
|
101
114
|
#
|
102
115
|
# A string that should be inserted into a document when selecting
|
103
|
-
# 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.
|
104
118
|
#
|
105
119
|
# The `insertText` is subject to interpretation by the client side.
|
106
120
|
# Some tools might not take the string literally. For example
|
107
|
-
# VS Code when code complete is requested in this example
|
108
|
-
# and a completion item with an `insertText` of
|
109
|
-
# will only insert `sole`. Therefore it is
|
110
|
-
# 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.
|
111
126
|
#
|
112
127
|
# @return [string]
|
113
128
|
def insert_text
|
@@ -115,8 +130,9 @@ module LanguageServer
|
|
115
130
|
end
|
116
131
|
|
117
132
|
#
|
118
|
-
# The format of the insert text. The format applies to both the
|
119
|
-
# and the `newText` property of a provided
|
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`.
|
120
136
|
#
|
121
137
|
# @return [InsertTextFormat]
|
122
138
|
def insert_text_format
|
@@ -124,25 +140,50 @@ module LanguageServer
|
|
124
140
|
end
|
125
141
|
|
126
142
|
#
|
127
|
-
#
|
128
|
-
#
|
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.
|
129
166
|
#
|
130
|
-
# *Note:* The
|
131
|
-
#
|
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.
|
132
173
|
#
|
133
|
-
# @return [TextEdit]
|
174
|
+
# @return [TextEdit | InsertReplaceEdit]
|
134
175
|
def text_edit
|
135
176
|
attributes.fetch(:textEdit)
|
136
177
|
end
|
137
178
|
|
138
179
|
#
|
139
180
|
# An optional array of additional text edits that are applied when
|
140
|
-
# selecting this completion. Edits must not overlap (including the same
|
141
|
-
# 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.
|
142
183
|
#
|
143
|
-
# Additional text edits should be used to change text unrelated to the
|
144
|
-
# (for example adding an import statement at the
|
145
|
-
# 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).
|
146
187
|
#
|
147
188
|
# @return [TextEdit[]]
|
148
189
|
def additional_text_edits
|
@@ -150,9 +191,10 @@ module LanguageServer
|
|
150
191
|
end
|
151
192
|
|
152
193
|
#
|
153
|
-
# An optional set of characters that when pressed while this completion is
|
154
|
-
# then type that character. *Note* that all
|
155
|
-
# 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.
|
156
198
|
#
|
157
199
|
# @return [string[]]
|
158
200
|
def commit_characters
|
@@ -160,9 +202,9 @@ module LanguageServer
|
|
160
202
|
end
|
161
203
|
|
162
204
|
#
|
163
|
-
# An optional command that is executed *after* inserting this completion.
|
164
|
-
# additional modifications to the current document should be
|
165
|
-
# 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.
|
166
208
|
#
|
167
209
|
# @return [Command]
|
168
210
|
def command
|
@@ -170,7 +212,7 @@ module LanguageServer
|
|
170
212
|
end
|
171
213
|
|
172
214
|
#
|
173
|
-
#
|
215
|
+
# A data entry field that is preserved on a completion item between
|
174
216
|
# a completion and a completion resolve request.
|
175
217
|
#
|
176
218
|
# @return [any]
|