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
@@ -18,7 +18,8 @@ module LanguageServer
|
|
18
18
|
end
|
19
19
|
|
20
20
|
#
|
21
|
-
# One or more signatures.
|
21
|
+
# One or more signatures. If no signaures are availabe the signature help
|
22
|
+
# request should return `null`.
|
22
23
|
#
|
23
24
|
# @return [SignatureInformation[]]
|
24
25
|
def signatures
|
@@ -27,10 +28,12 @@ module LanguageServer
|
|
27
28
|
|
28
29
|
#
|
29
30
|
# The active signature. If omitted or the value lies outside the
|
30
|
-
# range of `signatures` the value defaults to zero or is
|
31
|
-
# `
|
32
|
-
#
|
33
|
-
#
|
31
|
+
# range of `signatures` the value defaults to zero or is ignore if
|
32
|
+
# the `SignatureHelp` as no signatures.
|
33
|
+
#
|
34
|
+
# Whenever possible implementors should make an active decision about
|
35
|
+
# the active signature and shouldn't rely on a default value.
|
36
|
+
#
|
34
37
|
# In future version of the protocol this property might become
|
35
38
|
# mandatory to better express this.
|
36
39
|
#
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class SignatureHelpClientCapabilities
|
5
|
+
def initialize(dynamic_registration: nil, signature_information: nil, context_support: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
|
9
|
+
@attributes[:signatureInformation] = signature_information if signature_information
|
10
|
+
@attributes[:contextSupport] = context_support if context_support
|
11
|
+
|
12
|
+
@attributes.freeze
|
13
|
+
end
|
14
|
+
|
15
|
+
#
|
16
|
+
# Whether signature help supports dynamic registration.
|
17
|
+
#
|
18
|
+
# @return [boolean]
|
19
|
+
def dynamic_registration
|
20
|
+
attributes.fetch(:dynamicRegistration)
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# The client supports the following `SignatureInformation`
|
25
|
+
# specific properties.
|
26
|
+
#
|
27
|
+
# @return [{ documentationFormat?: MarkupKind[]; parameterInformation?: { labelOffsetSupport?: boolean; }; }]
|
28
|
+
def signature_information
|
29
|
+
attributes.fetch(:signatureInformation)
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# The client supports to send additional context information for a
|
34
|
+
# `textDocument/signatureHelp` request. A client that opts into
|
35
|
+
# contextSupport will also support the `retriggerCharacters` on
|
36
|
+
# `SignatureHelpOptions`.
|
37
|
+
#
|
38
|
+
# @return [boolean]
|
39
|
+
def context_support
|
40
|
+
attributes.fetch(:contextSupport)
|
41
|
+
end
|
42
|
+
|
43
|
+
attr_reader :attributes
|
44
|
+
|
45
|
+
def to_hash
|
46
|
+
attributes
|
47
|
+
end
|
48
|
+
|
49
|
+
def to_json(*args)
|
50
|
+
to_hash.to_json(*args)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Additional information about the context in which a signature help request was triggered.
|
6
|
+
#
|
7
|
+
class SignatureHelpContext
|
8
|
+
def initialize(trigger_kind:, trigger_character: nil, is_retrigger:, active_signature_help: nil)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:triggerKind] = trigger_kind
|
12
|
+
@attributes[:triggerCharacter] = trigger_character if trigger_character
|
13
|
+
@attributes[:isRetrigger] = is_retrigger
|
14
|
+
@attributes[:activeSignatureHelp] = active_signature_help if active_signature_help
|
15
|
+
|
16
|
+
@attributes.freeze
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# Action that caused signature help to be triggered.
|
21
|
+
#
|
22
|
+
# @return [CompletionTriggerKind]
|
23
|
+
def trigger_kind
|
24
|
+
attributes.fetch(:triggerKind)
|
25
|
+
end
|
26
|
+
|
27
|
+
#
|
28
|
+
# Character that caused signature help to be triggered.
|
29
|
+
#
|
30
|
+
# This is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter`
|
31
|
+
#
|
32
|
+
# @return [string]
|
33
|
+
def trigger_character
|
34
|
+
attributes.fetch(:triggerCharacter)
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# `true` if signature help was already showing when it was triggered.
|
39
|
+
#
|
40
|
+
# Retriggers occur when the signature help is already active and can be caused by actions such as
|
41
|
+
# typing a trigger character, a cursor move, or document content changes.
|
42
|
+
#
|
43
|
+
# @return [boolean]
|
44
|
+
def is_retrigger
|
45
|
+
attributes.fetch(:isRetrigger)
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# The currently active `SignatureHelp`.
|
50
|
+
#
|
51
|
+
# The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on
|
52
|
+
# the user navigating through available signatures.
|
53
|
+
#
|
54
|
+
# @return [SignatureHelp]
|
55
|
+
def active_signature_help
|
56
|
+
attributes.fetch(:activeSignatureHelp)
|
57
|
+
end
|
58
|
+
|
59
|
+
attr_reader :attributes
|
60
|
+
|
61
|
+
def to_hash
|
62
|
+
attributes
|
63
|
+
end
|
64
|
+
|
65
|
+
def to_json(*args)
|
66
|
+
to_hash.to_json(*args)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -1,14 +1,13 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
|
5
|
-
|
6
|
-
#
|
7
|
-
class SignatureHelpOptions
|
8
|
-
def initialize(trigger_characters: nil)
|
4
|
+
class SignatureHelpOptions < WorkDoneProgressOptions
|
5
|
+
def initialize(work_done_progress: nil, trigger_characters: nil, retrigger_characters: nil)
|
9
6
|
@attributes = {}
|
10
7
|
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
11
9
|
@attributes[:triggerCharacters] = trigger_characters if trigger_characters
|
10
|
+
@attributes[:retriggerCharacters] = retrigger_characters if retrigger_characters
|
12
11
|
|
13
12
|
@attributes.freeze
|
14
13
|
end
|
@@ -22,6 +21,17 @@ module LanguageServer
|
|
22
21
|
attributes.fetch(:triggerCharacters)
|
23
22
|
end
|
24
23
|
|
24
|
+
#
|
25
|
+
# List of characters that re-trigger signature help.
|
26
|
+
#
|
27
|
+
# These trigger characters are only active when signature help is already showing. All trigger characters
|
28
|
+
# are also counted as re-trigger characters.
|
29
|
+
#
|
30
|
+
# @return [string[]]
|
31
|
+
def retrigger_characters
|
32
|
+
attributes.fetch(:retriggerCharacters)
|
33
|
+
end
|
34
|
+
|
25
35
|
attr_reader :attributes
|
26
36
|
|
27
37
|
def to_hash
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class SignatureHelpParams < WorkDoneProgressParams
|
5
|
+
def initialize(work_done_token: nil, context: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:workDoneToken] = work_done_token if work_done_token
|
9
|
+
@attributes[:context] = context if context
|
10
|
+
|
11
|
+
@attributes.freeze
|
12
|
+
end
|
13
|
+
|
14
|
+
#
|
15
|
+
# The signature help context. This is only available if the client specifies
|
16
|
+
# to send this using the client capability `textDocument.signatureHelp.contextSupport === true`
|
17
|
+
#
|
18
|
+
# @return [SignatureHelpContext]
|
19
|
+
def context
|
20
|
+
attributes.fetch(:context)
|
21
|
+
end
|
22
|
+
|
23
|
+
attr_reader :attributes
|
24
|
+
|
25
|
+
def to_hash
|
26
|
+
attributes
|
27
|
+
end
|
28
|
+
|
29
|
+
def to_json(*args)
|
30
|
+
to_hash.to_json(*args)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -1,24 +1,17 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class SignatureHelpRegistrationOptions <
|
5
|
-
def initialize(
|
4
|
+
class SignatureHelpRegistrationOptions < SignatureHelpOptions
|
5
|
+
def initialize(work_done_progress: nil, trigger_characters: nil, retrigger_characters: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
8
9
|
@attributes[:triggerCharacters] = trigger_characters if trigger_characters
|
10
|
+
@attributes[:retriggerCharacters] = retrigger_characters if retrigger_characters
|
9
11
|
|
10
12
|
@attributes.freeze
|
11
13
|
end
|
12
14
|
|
13
|
-
#
|
14
|
-
# The characters that trigger signature help
|
15
|
-
# automatically.
|
16
|
-
#
|
17
|
-
# @return [string[]]
|
18
|
-
def trigger_characters
|
19
|
-
attributes.fetch(:triggerCharacters)
|
20
|
-
end
|
21
|
-
|
22
15
|
attr_reader :attributes
|
23
16
|
|
24
17
|
def to_hash
|
@@ -8,6 +8,7 @@ module LanguageServer
|
|
8
8
|
def initialize(document_selector:, sync_kind:)
|
9
9
|
@attributes = {}
|
10
10
|
|
11
|
+
@attributes[:documentSelector] = document_selector
|
11
12
|
@attributes[:syncKind] = sync_kind
|
12
13
|
|
13
14
|
@attributes.freeze
|
@@ -17,7 +18,7 @@ module LanguageServer
|
|
17
18
|
# How documents are synced to the server. See TextDocumentSyncKind.Full
|
18
19
|
# and TextDocumentSyncKind.Incremental.
|
19
20
|
#
|
20
|
-
# @return [
|
21
|
+
# @return [any]
|
21
22
|
def sync_kind
|
22
23
|
attributes.fetch(:syncKind)
|
23
24
|
end
|
@@ -5,158 +5,140 @@ module LanguageServer
|
|
5
5
|
# Text document specific client capabilities.
|
6
6
|
#
|
7
7
|
class TextDocumentClientCapabilities
|
8
|
-
def initialize(synchronization: nil, completion: nil, hover: nil, signature_help: nil,
|
8
|
+
def initialize(synchronization: nil, completion: nil, hover: nil, signature_help: nil, declaration: nil, definition: nil, type_definition: nil, implementation: nil, references: nil, document_highlight: nil, document_symbol: nil, code_action: nil, code_lens: nil, document_link: nil, color_provider: nil, formatting: nil, range_formatting: nil, on_type_formatting: nil, rename: nil, publish_diagnostics: nil, folding_range: nil, selection_range: nil)
|
9
9
|
@attributes = {}
|
10
10
|
|
11
11
|
@attributes[:synchronization] = synchronization if synchronization
|
12
12
|
@attributes[:completion] = completion if completion
|
13
13
|
@attributes[:hover] = hover if hover
|
14
14
|
@attributes[:signatureHelp] = signature_help if signature_help
|
15
|
-
@attributes[:
|
16
|
-
@attributes[:documentHighlight] = document_highlight if document_highlight
|
17
|
-
@attributes[:documentSymbol] = document_symbol if document_symbol
|
18
|
-
@attributes[:formatting] = formatting if formatting
|
19
|
-
@attributes[:rangeFormatting] = range_formatting if range_formatting
|
20
|
-
@attributes[:onTypeFormatting] = on_type_formatting if on_type_formatting
|
15
|
+
@attributes[:declaration] = declaration if declaration
|
21
16
|
@attributes[:definition] = definition if definition
|
22
17
|
@attributes[:typeDefinition] = type_definition if type_definition
|
23
18
|
@attributes[:implementation] = implementation if implementation
|
19
|
+
@attributes[:references] = references if references
|
20
|
+
@attributes[:documentHighlight] = document_highlight if document_highlight
|
21
|
+
@attributes[:documentSymbol] = document_symbol if document_symbol
|
24
22
|
@attributes[:codeAction] = code_action if code_action
|
25
23
|
@attributes[:codeLens] = code_lens if code_lens
|
26
24
|
@attributes[:documentLink] = document_link if document_link
|
27
25
|
@attributes[:colorProvider] = color_provider if color_provider
|
26
|
+
@attributes[:formatting] = formatting if formatting
|
27
|
+
@attributes[:rangeFormatting] = range_formatting if range_formatting
|
28
|
+
@attributes[:onTypeFormatting] = on_type_formatting if on_type_formatting
|
28
29
|
@attributes[:rename] = rename if rename
|
29
30
|
@attributes[:publishDiagnostics] = publish_diagnostics if publish_diagnostics
|
30
31
|
@attributes[:foldingRange] = folding_range if folding_range
|
32
|
+
@attributes[:selectionRange] = selection_range if selection_range
|
31
33
|
|
32
34
|
@attributes.freeze
|
33
35
|
end
|
34
36
|
|
35
|
-
# @return [
|
37
|
+
# @return [TextDocumentSyncClientCapabilities]
|
36
38
|
def synchronization
|
37
39
|
attributes.fetch(:synchronization)
|
38
40
|
end
|
39
41
|
|
40
42
|
#
|
41
|
-
# Capabilities specific to the `textDocument/completion`
|
43
|
+
# Capabilities specific to the `textDocument/completion` request.
|
42
44
|
#
|
43
|
-
# @return [
|
45
|
+
# @return [CompletionClientCapabilities]
|
44
46
|
def completion
|
45
47
|
attributes.fetch(:completion)
|
46
48
|
end
|
47
49
|
|
48
50
|
#
|
49
|
-
# Capabilities specific to the `textDocument/hover`
|
51
|
+
# Capabilities specific to the `textDocument/hover` request.
|
50
52
|
#
|
51
|
-
# @return [
|
53
|
+
# @return [HoverClientCapabilities]
|
52
54
|
def hover
|
53
55
|
attributes.fetch(:hover)
|
54
56
|
end
|
55
57
|
|
56
58
|
#
|
57
|
-
# Capabilities specific to the `textDocument/signatureHelp`
|
59
|
+
# Capabilities specific to the `textDocument/signatureHelp` request.
|
58
60
|
#
|
59
|
-
# @return [
|
61
|
+
# @return [SignatureHelpClientCapabilities]
|
60
62
|
def signature_help
|
61
63
|
attributes.fetch(:signatureHelp)
|
62
64
|
end
|
63
65
|
|
64
66
|
#
|
65
|
-
# Capabilities specific to the `textDocument/
|
66
|
-
#
|
67
|
-
# @return [{ dynamicRegistration?: boolean; }]
|
68
|
-
def references
|
69
|
-
attributes.fetch(:references)
|
70
|
-
end
|
71
|
-
|
72
|
-
#
|
73
|
-
# Capabilities specific to the `textDocument/documentHighlight`
|
74
|
-
#
|
75
|
-
# @return [{ dynamicRegistration?: boolean; }]
|
76
|
-
def document_highlight
|
77
|
-
attributes.fetch(:documentHighlight)
|
78
|
-
end
|
79
|
-
|
80
|
-
#
|
81
|
-
# Capabilities specific to the `textDocument/documentSymbol`
|
67
|
+
# Capabilities specific to the `textDocument/declaration` request.
|
82
68
|
#
|
83
|
-
# @return [
|
84
|
-
def
|
85
|
-
attributes.fetch(:
|
69
|
+
# @return [DeclarationClientCapabilities]
|
70
|
+
def declaration
|
71
|
+
attributes.fetch(:declaration)
|
86
72
|
end
|
87
73
|
|
88
74
|
#
|
89
|
-
# Capabilities specific to the `textDocument/
|
75
|
+
# Capabilities specific to the `textDocument/definition` request.
|
90
76
|
#
|
91
|
-
# @return [
|
92
|
-
def
|
93
|
-
attributes.fetch(:
|
77
|
+
# @return [DefinitionClientCapabilities]
|
78
|
+
def definition
|
79
|
+
attributes.fetch(:definition)
|
94
80
|
end
|
95
81
|
|
96
82
|
#
|
97
|
-
# Capabilities specific to the `textDocument/
|
83
|
+
# Capabilities specific to the `textDocument/typeDefinition` request.
|
98
84
|
#
|
99
|
-
# @return [
|
100
|
-
def
|
101
|
-
attributes.fetch(:
|
85
|
+
# @return [TypeDefinitionClientCapabilities]
|
86
|
+
def type_definition
|
87
|
+
attributes.fetch(:typeDefinition)
|
102
88
|
end
|
103
89
|
|
104
90
|
#
|
105
|
-
# Capabilities specific to the `textDocument/
|
91
|
+
# Capabilities specific to the `textDocument/implementation` request.
|
106
92
|
#
|
107
|
-
# @return [
|
108
|
-
def
|
109
|
-
attributes.fetch(:
|
93
|
+
# @return [ImplementationClientCapabilities]
|
94
|
+
def implementation
|
95
|
+
attributes.fetch(:implementation)
|
110
96
|
end
|
111
97
|
|
112
98
|
#
|
113
|
-
# Capabilities specific to the `textDocument/
|
99
|
+
# Capabilities specific to the `textDocument/references` request.
|
114
100
|
#
|
115
|
-
# @return [
|
116
|
-
def
|
117
|
-
attributes.fetch(:
|
101
|
+
# @return [ReferenceClientCapabilities]
|
102
|
+
def references
|
103
|
+
attributes.fetch(:references)
|
118
104
|
end
|
119
105
|
|
120
106
|
#
|
121
|
-
# Capabilities specific to the `textDocument/
|
122
|
-
#
|
123
|
-
# Since 3.6.0
|
107
|
+
# Capabilities specific to the `textDocument/documentHighlight` request.
|
124
108
|
#
|
125
|
-
# @return [
|
126
|
-
def
|
127
|
-
attributes.fetch(:
|
109
|
+
# @return [DocumentHighlightClientCapabilities]
|
110
|
+
def document_highlight
|
111
|
+
attributes.fetch(:documentHighlight)
|
128
112
|
end
|
129
113
|
|
130
114
|
#
|
131
|
-
# Capabilities specific to the `textDocument/
|
132
|
-
#
|
133
|
-
# Since 3.6.0
|
115
|
+
# Capabilities specific to the `textDocument/documentSymbol` request.
|
134
116
|
#
|
135
|
-
# @return [
|
136
|
-
def
|
137
|
-
attributes.fetch(:
|
117
|
+
# @return [DocumentSymbolClientCapabilities]
|
118
|
+
def document_symbol
|
119
|
+
attributes.fetch(:documentSymbol)
|
138
120
|
end
|
139
121
|
|
140
122
|
#
|
141
|
-
# Capabilities specific to the `textDocument/codeAction`
|
123
|
+
# Capabilities specific to the `textDocument/codeAction` request.
|
142
124
|
#
|
143
|
-
# @return [
|
125
|
+
# @return [CodeActionClientCapabilities]
|
144
126
|
def code_action
|
145
127
|
attributes.fetch(:codeAction)
|
146
128
|
end
|
147
129
|
|
148
130
|
#
|
149
|
-
# Capabilities specific to the `textDocument/codeLens`
|
131
|
+
# Capabilities specific to the `textDocument/codeLens` request.
|
150
132
|
#
|
151
|
-
# @return [
|
133
|
+
# @return [CodeLensClientCapabilities]
|
152
134
|
def code_lens
|
153
135
|
attributes.fetch(:codeLens)
|
154
136
|
end
|
155
137
|
|
156
138
|
#
|
157
|
-
# Capabilities specific to the `textDocument/documentLink`
|
139
|
+
# Capabilities specific to the `textDocument/documentLink` request.
|
158
140
|
#
|
159
|
-
# @return [
|
141
|
+
# @return [DocumentLinkClientCapabilities]
|
160
142
|
def document_link
|
161
143
|
attributes.fetch(:documentLink)
|
162
144
|
end
|
@@ -165,39 +147,68 @@ module LanguageServer
|
|
165
147
|
# Capabilities specific to the `textDocument/documentColor` and the
|
166
148
|
# `textDocument/colorPresentation` request.
|
167
149
|
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
# @return [{ dynamicRegistration?: boolean; }]
|
150
|
+
# @return [DocumentColorClientCapabilities]
|
171
151
|
def color_provider
|
172
152
|
attributes.fetch(:colorProvider)
|
173
153
|
end
|
174
154
|
|
175
155
|
#
|
176
|
-
# Capabilities specific to the `textDocument/
|
156
|
+
# Capabilities specific to the `textDocument/formatting` request.
|
157
|
+
#
|
158
|
+
# @return [DocumentFormattingClientCapabilities]
|
159
|
+
def formatting
|
160
|
+
attributes.fetch(:formatting)
|
161
|
+
end
|
162
|
+
|
163
|
+
#
|
164
|
+
# Capabilities specific to the `textDocument/rangeFormatting` request.
|
165
|
+
#
|
166
|
+
# @return [DocumentRangeFormattingClientCapabilities]
|
167
|
+
def range_formatting
|
168
|
+
attributes.fetch(:rangeFormatting)
|
169
|
+
end
|
170
|
+
|
171
|
+
#
|
172
|
+
# request.
|
173
|
+
# Capabilities specific to the `textDocument/onTypeFormatting` request.
|
177
174
|
#
|
178
|
-
# @return [
|
175
|
+
# @return [DocumentOnTypeFormattingClientCapabilities]
|
176
|
+
def on_type_formatting
|
177
|
+
attributes.fetch(:onTypeFormatting)
|
178
|
+
end
|
179
|
+
|
180
|
+
#
|
181
|
+
# Capabilities specific to the `textDocument/rename` request.
|
182
|
+
#
|
183
|
+
# @return [RenameClientCapabilities]
|
179
184
|
def rename
|
180
185
|
attributes.fetch(:rename)
|
181
186
|
end
|
182
187
|
|
183
188
|
#
|
184
|
-
# Capabilities specific to `textDocument/publishDiagnostics
|
189
|
+
# Capabilities specific to the `textDocument/publishDiagnostics` notification.
|
185
190
|
#
|
186
|
-
# @return [
|
191
|
+
# @return [PublishDiagnosticsClientCapabilities]
|
187
192
|
def publish_diagnostics
|
188
193
|
attributes.fetch(:publishDiagnostics)
|
189
194
|
end
|
190
195
|
|
191
196
|
#
|
192
|
-
# Capabilities specific to `textDocument/foldingRange`
|
193
|
-
#
|
194
|
-
# Since 3.10.0
|
197
|
+
# Capabilities specific to the `textDocument/foldingRange` request.
|
195
198
|
#
|
196
|
-
# @return [
|
199
|
+
# @return [FoldingRangeClientCapabilities]
|
197
200
|
def folding_range
|
198
201
|
attributes.fetch(:foldingRange)
|
199
202
|
end
|
200
203
|
|
204
|
+
#
|
205
|
+
# Capabilities specific to the `textDocument/selectionRange` request.
|
206
|
+
#
|
207
|
+
# @return [SelectionRangeClientCapabilities]
|
208
|
+
def selection_range
|
209
|
+
attributes.fetch(:selectionRange)
|
210
|
+
end
|
211
|
+
|
201
212
|
attr_reader :attributes
|
202
213
|
|
203
214
|
def to_hash
|