language_server-protocol 3.12.0.0 → 3.15.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/language_server/protocol/constant.rb +12 -0
- data/lib/language_server/protocol/constant/code_action_kind.rb +12 -8
- data/lib/language_server/protocol/constant/completion_item_tag.rb +16 -0
- data/lib/language_server/protocol/constant/diagnostic_tag.rb +24 -0
- data/lib/language_server/protocol/constant/error_codes.rb +1 -0
- data/lib/language_server/protocol/constant/failure_handling_kind.rb +29 -0
- data/lib/language_server/protocol/constant/resource_operation_kind.rb +23 -0
- data/lib/language_server/protocol/constant/signature_help_trigger_kind.rb +23 -0
- data/lib/language_server/protocol/constant/text_document_sync_kind.rb +1 -0
- data/lib/language_server/protocol/interface.rb +174 -8
- data/lib/language_server/protocol/interface/apply_workspace_edit_response.rb +13 -1
- data/lib/language_server/protocol/interface/client_capabilities.rb +11 -2
- data/lib/language_server/protocol/interface/code_action.rb +14 -1
- data/lib/language_server/protocol/interface/code_action_client_capabilities.rb +52 -0
- data/lib/language_server/protocol/interface/code_action_context.rb +5 -1
- data/lib/language_server/protocol/interface/code_action_options.rb +3 -5
- data/lib/language_server/protocol/interface/code_action_params.rb +3 -2
- data/lib/language_server/protocol/interface/code_action_registration_options.rb +3 -1
- 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/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_item.rb +16 -5
- data/lib/language_server/protocol/interface/completion_options.rb +33 -11
- data/lib/language_server/protocol/interface/completion_params.rb +3 -2
- data/lib/language_server/protocol/interface/completion_registration_options.rb +4 -26
- data/lib/language_server/protocol/interface/create_file.rb +54 -0
- data/lib/language_server/protocol/interface/create_file_options.rb +45 -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 +54 -0
- data/lib/language_server/protocol/interface/delete_file_options.rb +45 -0
- data/lib/language_server/protocol/interface/diagnostic.rb +11 -2
- data/lib/language_server/protocol/interface/diagnostic_related_information.rb +1 -1
- 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 +10 -2
- 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 +8 -0
- 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_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 +14 -1
- 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 +96 -0
- data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +51 -0
- data/lib/language_server/protocol/interface/document_symbol_options.rb +25 -0
- data/lib/language_server/protocol/interface/document_symbol_params.rb +3 -2
- data/lib/language_server/protocol/interface/document_symbol_registration_options.rb +25 -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_system_watcher.rb +9 -1
- data/lib/language_server/protocol/interface/folding_range.rb +1 -1
- data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +55 -0
- data/lib/language_server/protocol/interface/folding_range_options.rb +25 -0
- data/lib/language_server/protocol/interface/{folding_range_request_param.rb → 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_client_capabilities.rb +43 -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 +12 -4
- data/lib/language_server/protocol/interface/initialize_result.rb +10 -1
- data/lib/language_server/protocol/interface/location_link.rb +66 -0
- data/lib/language_server/protocol/interface/markup_content.rb +1 -1
- data/lib/language_server/protocol/interface/notification_message.rb +2 -1
- data/lib/language_server/protocol/interface/parameter_information.rb +9 -3
- data/lib/language_server/protocol/interface/partial_result_params.rb +34 -0
- 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 +53 -0
- data/lib/language_server/protocol/interface/publish_diagnostics_params.rb +10 -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/rename_client_capabilities.rb +43 -0
- data/lib/language_server/protocol/interface/rename_file.rb +63 -0
- data/lib/language_server/protocol/interface/rename_file_options.rb +45 -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 +42 -0
- data/lib/language_server/protocol/interface/selection_range_client_capabilities.rb +35 -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/server_capabilities.rb +66 -56
- data/lib/language_server/protocol/interface/signature_help.rb +8 -5
- data/lib/language_server/protocol/interface/signature_help_client_capabilities.rb +55 -0
- data/lib/language_server/protocol/interface/signature_help_context.rb +71 -0
- data/lib/language_server/protocol/interface/signature_help_options.rb +15 -5
- data/lib/language_server/protocol/interface/signature_help_params.rb +35 -0
- data/lib/language_server/protocol/interface/signature_help_registration_options.rb +4 -11
- data/lib/language_server/protocol/interface/symbol_information.rb +1 -1
- 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 +90 -79
- data/lib/language_server/protocol/interface/text_document_content_change_event.rb +8 -4
- data/lib/language_server/protocol/interface/text_document_registration_options.rb +3 -0
- 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 -6
- 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 +5 -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 +11 -5
- data/lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb +53 -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 +42 -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.rb +1 -0
- data/lib/language_server/protocol/transport/io.rb +2 -0
- data/lib/language_server/protocol/transport/io/reader.rb +47 -0
- data/lib/language_server/protocol/transport/io/writer.rb +34 -0
- data/lib/language_server/protocol/transport/stdio/reader.rb +3 -29
- data/lib/language_server/protocol/transport/stdio/writer.rb +3 -18
- data/lib/language_server/protocol/version.rb +1 -1
- metadata +98 -30
- data/.gitignore +0 -10
- data/.travis.yml +0 -5
- data/CHANGELOG.md +0 -17
- 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 -28
- data/docker-compose.ci.yml +0 -16
- data/docker-compose.override.yml +0 -15
- data/docker-compose.yml +0 -37
- data/language_server-protocol.gemspec +0 -31
- data/lib/language_server/protocol/interface/workspace_client_capabilites.rb +0 -82
- 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,25 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class DocumentHighlightOptions < WorkDoneProgressOptions
|
5
|
+
def initialize(work_done_progress: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
9
|
+
|
10
|
+
@attributes.freeze
|
11
|
+
end
|
12
|
+
|
13
|
+
attr_reader :attributes
|
14
|
+
|
15
|
+
def to_hash
|
16
|
+
attributes
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_json(*args)
|
20
|
+
to_hash.to_json(*args)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class DocumentHighlightParams < PartialResultParams
|
5
|
+
def initialize(partial_result_token: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:partialResultToken] = partial_result_token if partial_result_token
|
9
|
+
|
10
|
+
@attributes.freeze
|
11
|
+
end
|
12
|
+
|
13
|
+
attr_reader :attributes
|
14
|
+
|
15
|
+
def to_hash
|
16
|
+
attributes
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_json(*args)
|
20
|
+
to_hash.to_json(*args)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class DocumentHighlightRegistrationOptions < DocumentHighlightOptions
|
5
|
+
def initialize(work_done_progress: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
9
|
+
|
10
|
+
@attributes.freeze
|
11
|
+
end
|
12
|
+
|
13
|
+
attr_reader :attributes
|
14
|
+
|
15
|
+
def to_hash
|
16
|
+
attributes
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_json(*args)
|
20
|
+
to_hash.to_json(*args)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -6,11 +6,12 @@ module LanguageServer
|
|
6
6
|
# text document or a web site.
|
7
7
|
#
|
8
8
|
class DocumentLink
|
9
|
-
def initialize(range:, target: nil, data: nil)
|
9
|
+
def initialize(range:, target: nil, tooltip: nil, data: nil)
|
10
10
|
@attributes = {}
|
11
11
|
|
12
12
|
@attributes[:range] = range
|
13
13
|
@attributes[:target] = target if target
|
14
|
+
@attributes[:tooltip] = tooltip if tooltip
|
14
15
|
@attributes[:data] = data if data
|
15
16
|
|
16
17
|
@attributes.freeze
|
@@ -32,6 +33,18 @@ module LanguageServer
|
|
32
33
|
attributes.fetch(:target)
|
33
34
|
end
|
34
35
|
|
36
|
+
#
|
37
|
+
# The tooltip text when you hover over this link.
|
38
|
+
#
|
39
|
+
# If a tooltip is provided, is will be displayed in a string that includes instructions on how to
|
40
|
+
# trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,
|
41
|
+
# user settings, and localization.
|
42
|
+
#
|
43
|
+
# @return [string]
|
44
|
+
def tooltip
|
45
|
+
attributes.fetch(:tooltip)
|
46
|
+
end
|
47
|
+
|
35
48
|
#
|
36
49
|
# A data entry field that is preserved on a document link between a
|
37
50
|
# DocumentLinkRequest and a DocumentLinkResolveRequest.
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class DocumentLinkClientCapabilities
|
5
|
+
def initialize(dynamic_registration: nil, tooltip_support: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
|
9
|
+
@attributes[:tooltipSupport] = tooltip_support if tooltip_support
|
10
|
+
|
11
|
+
@attributes.freeze
|
12
|
+
end
|
13
|
+
|
14
|
+
#
|
15
|
+
# Whether document link supports dynamic registration.
|
16
|
+
#
|
17
|
+
# @return [boolean]
|
18
|
+
def dynamic_registration
|
19
|
+
attributes.fetch(:dynamicRegistration)
|
20
|
+
end
|
21
|
+
|
22
|
+
#
|
23
|
+
# Whether the client supports the `tooltip` property on `DocumentLink`.
|
24
|
+
#
|
25
|
+
# @return [boolean]
|
26
|
+
def tooltip_support
|
27
|
+
attributes.fetch(:tooltipSupport)
|
28
|
+
end
|
29
|
+
|
30
|
+
attr_reader :attributes
|
31
|
+
|
32
|
+
def to_hash
|
33
|
+
attributes
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_json(*args)
|
37
|
+
to_hash.to_json(*args)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -1,13 +1,11 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
|
5
|
-
|
6
|
-
#
|
7
|
-
class DocumentLinkOptions
|
8
|
-
def initialize(resolve_provider: nil)
|
4
|
+
class DocumentLinkOptions < 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 DocumentLinkParams
|
5
|
-
def initialize(text_document:)
|
4
|
+
class DocumentLinkParams < 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 DocumentLinkRegistrationOptions <
|
5
|
-
def initialize(
|
4
|
+
class DocumentLinkRegistrationOptions < DocumentLinkOptions
|
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
|
-
# Document links have 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
|
data/lib/language_server/protocol/interface/document_on_type_formatting_client_capabilities.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class DocumentOnTypeFormattingClientCapabilities
|
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 on type formatting 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,7 +1,7 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class DocumentOnTypeFormattingParams
|
4
|
+
class DocumentOnTypeFormattingParams < TextDocumentPositionParams
|
5
5
|
def initialize(text_document:, position:, ch:, options:)
|
6
6
|
@attributes = {}
|
7
7
|
|
@@ -13,22 +13,6 @@ module LanguageServer
|
|
13
13
|
@attributes.freeze
|
14
14
|
end
|
15
15
|
|
16
|
-
#
|
17
|
-
# The document to format.
|
18
|
-
#
|
19
|
-
# @return [TextDocumentIdentifier]
|
20
|
-
def text_document
|
21
|
-
attributes.fetch(:textDocument)
|
22
|
-
end
|
23
|
-
|
24
|
-
#
|
25
|
-
# The position at which this request was sent.
|
26
|
-
#
|
27
|
-
# @return [Position]
|
28
|
-
def position
|
29
|
-
attributes.fetch(:position)
|
30
|
-
end
|
31
|
-
|
32
16
|
#
|
33
17
|
# The character that has been typed.
|
34
18
|
#
|
data/lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class DocumentOnTypeFormattingRegistrationOptions <
|
5
|
-
def initialize(
|
4
|
+
class DocumentOnTypeFormattingRegistrationOptions < DocumentOnTypeFormattingOptions
|
5
|
+
def initialize(first_trigger_character:, more_trigger_character: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
8
|
@attributes[:firstTriggerCharacter] = first_trigger_character
|
@@ -11,22 +11,6 @@ module LanguageServer
|
|
11
11
|
@attributes.freeze
|
12
12
|
end
|
13
13
|
|
14
|
-
#
|
15
|
-
# A character on which formatting should be triggered, like `}`.
|
16
|
-
#
|
17
|
-
# @return [string]
|
18
|
-
def first_trigger_character
|
19
|
-
attributes.fetch(:firstTriggerCharacter)
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# More trigger characters.
|
24
|
-
#
|
25
|
-
# @return [string[]]
|
26
|
-
def more_trigger_character
|
27
|
-
attributes.fetch(:moreTriggerCharacter)
|
28
|
-
end
|
29
|
-
|
30
14
|
attr_reader :attributes
|
31
15
|
|
32
16
|
def to_hash
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class DocumentRangeFormattingClientCapabilities
|
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 formatting 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
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class DocumentRangeFormattingOptions < WorkDoneProgressOptions
|
5
|
+
def initialize(work_done_progress: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
9
|
+
|
10
|
+
@attributes.freeze
|
11
|
+
end
|
12
|
+
|
13
|
+
attr_reader :attributes
|
14
|
+
|
15
|
+
def to_hash
|
16
|
+
attributes
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_json(*args)
|
20
|
+
to_hash.to_json(*args)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class DocumentRangeFormattingParams
|
5
|
-
def initialize(text_document:, range:, options:)
|
4
|
+
class DocumentRangeFormattingParams < WorkDoneProgressParams
|
5
|
+
def initialize(work_done_token: nil, text_document:, range:, options:)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:workDoneToken] = work_done_token if work_done_token
|
8
9
|
@attributes[:textDocument] = text_document
|
9
10
|
@attributes[:range] = range
|
10
11
|
@attributes[:options] = options
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class DocumentRangeFormattingRegistrationOptions < DocumentRangeFormattingOptions
|
5
|
+
def initialize(work_done_progress: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
9
|
+
|
10
|
+
@attributes.freeze
|
11
|
+
end
|
12
|
+
|
13
|
+
attr_reader :attributes
|
14
|
+
|
15
|
+
def to_hash
|
16
|
+
attributes
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_json(*args)
|
20
|
+
to_hash.to_json(*args)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be
|
6
|
+
# hierarchical and they have two ranges: one that encloses its definition and one that points to its most interesting range,
|
7
|
+
# e.g. the range of an identifier.
|
8
|
+
#
|
9
|
+
class DocumentSymbol
|
10
|
+
def initialize(name:, detail: nil, kind:, deprecated: nil, range:, selection_range:, children: nil)
|
11
|
+
@attributes = {}
|
12
|
+
|
13
|
+
@attributes[:name] = name
|
14
|
+
@attributes[:detail] = detail if detail
|
15
|
+
@attributes[:kind] = kind
|
16
|
+
@attributes[:deprecated] = deprecated if deprecated
|
17
|
+
@attributes[:range] = range
|
18
|
+
@attributes[:selectionRange] = selection_range
|
19
|
+
@attributes[:children] = children if children
|
20
|
+
|
21
|
+
@attributes.freeze
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# The name of this symbol. Will be displayed in the user interface and therefore must not be
|
26
|
+
# an empty string or a string only consisting of white spaces.
|
27
|
+
#
|
28
|
+
# @return [string]
|
29
|
+
def name
|
30
|
+
attributes.fetch(:name)
|
31
|
+
end
|
32
|
+
|
33
|
+
#
|
34
|
+
# More detail for this symbol, e.g the signature of a function.
|
35
|
+
#
|
36
|
+
# @return [string]
|
37
|
+
def detail
|
38
|
+
attributes.fetch(:detail)
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# The kind of this symbol.
|
43
|
+
#
|
44
|
+
# @return [any]
|
45
|
+
def kind
|
46
|
+
attributes.fetch(:kind)
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# Indicates if this symbol is deprecated.
|
51
|
+
#
|
52
|
+
# @return [boolean]
|
53
|
+
def deprecated
|
54
|
+
attributes.fetch(:deprecated)
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# The range enclosing this symbol not including leading/trailing whitespace but everything else
|
59
|
+
# like comments. This information is typically used to determine if the clients cursor is
|
60
|
+
# inside the symbol to reveal in the symbol in the UI.
|
61
|
+
#
|
62
|
+
# @return [Range]
|
63
|
+
def range
|
64
|
+
attributes.fetch(:range)
|
65
|
+
end
|
66
|
+
|
67
|
+
#
|
68
|
+
# The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.
|
69
|
+
# Must be contained by the `range`.
|
70
|
+
#
|
71
|
+
# @return [Range]
|
72
|
+
def selection_range
|
73
|
+
attributes.fetch(:selectionRange)
|
74
|
+
end
|
75
|
+
|
76
|
+
#
|
77
|
+
# Children of this symbol, e.g. properties of a class.
|
78
|
+
#
|
79
|
+
# @return [DocumentSymbol[]]
|
80
|
+
def children
|
81
|
+
attributes.fetch(:children)
|
82
|
+
end
|
83
|
+
|
84
|
+
attr_reader :attributes
|
85
|
+
|
86
|
+
def to_hash
|
87
|
+
attributes
|
88
|
+
end
|
89
|
+
|
90
|
+
def to_json(*args)
|
91
|
+
to_hash.to_json(*args)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|