language_server-protocol 3.14.0.0 → 3.15.0.2
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 +8 -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/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 +158 -6
- 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/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/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_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/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_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 +7 -4
- data/lib/language_server/protocol/interface/notification_message.rb +2 -1
- 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_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 +87 -87
- 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 +2 -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 +1 -1
- 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 +92 -31
- data/.gitignore +0 -10
- data/.travis.yml +0 -5
- data/CHANGELOG.md +0 -21
- 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 -46
- data/docker-compose.ci.yml +0 -18
- data/docker-compose.override.yml +0 -19
- data/docker-compose.yml +0 -45
- data/language_server-protocol.gemspec +0 -31
- 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,210 +5,210 @@ 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[:references] = references if references
|
|
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
|
|
21
15
|
@attributes[:declaration] = declaration if declaration
|
|
22
16
|
@attributes[:definition] = definition if definition
|
|
23
17
|
@attributes[:typeDefinition] = type_definition if type_definition
|
|
24
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
|
|
25
22
|
@attributes[:codeAction] = code_action if code_action
|
|
26
23
|
@attributes[:codeLens] = code_lens if code_lens
|
|
27
24
|
@attributes[:documentLink] = document_link if document_link
|
|
28
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
|
|
29
29
|
@attributes[:rename] = rename if rename
|
|
30
30
|
@attributes[:publishDiagnostics] = publish_diagnostics if publish_diagnostics
|
|
31
31
|
@attributes[:foldingRange] = folding_range if folding_range
|
|
32
|
+
@attributes[:selectionRange] = selection_range if selection_range
|
|
32
33
|
|
|
33
34
|
@attributes.freeze
|
|
34
35
|
end
|
|
35
36
|
|
|
36
|
-
# @return [
|
|
37
|
+
# @return [TextDocumentSyncClientCapabilities]
|
|
37
38
|
def synchronization
|
|
38
39
|
attributes.fetch(:synchronization)
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
#
|
|
42
|
-
# Capabilities specific to the `textDocument/completion`
|
|
43
|
+
# Capabilities specific to the `textDocument/completion` request.
|
|
43
44
|
#
|
|
44
|
-
# @return [
|
|
45
|
+
# @return [CompletionClientCapabilities]
|
|
45
46
|
def completion
|
|
46
47
|
attributes.fetch(:completion)
|
|
47
48
|
end
|
|
48
49
|
|
|
49
50
|
#
|
|
50
|
-
# Capabilities specific to the `textDocument/hover`
|
|
51
|
+
# Capabilities specific to the `textDocument/hover` request.
|
|
51
52
|
#
|
|
52
|
-
# @return [
|
|
53
|
+
# @return [HoverClientCapabilities]
|
|
53
54
|
def hover
|
|
54
55
|
attributes.fetch(:hover)
|
|
55
56
|
end
|
|
56
57
|
|
|
57
58
|
#
|
|
58
|
-
# Capabilities specific to the `textDocument/signatureHelp`
|
|
59
|
+
# Capabilities specific to the `textDocument/signatureHelp` request.
|
|
59
60
|
#
|
|
60
|
-
# @return [
|
|
61
|
+
# @return [SignatureHelpClientCapabilities]
|
|
61
62
|
def signature_help
|
|
62
63
|
attributes.fetch(:signatureHelp)
|
|
63
64
|
end
|
|
64
65
|
|
|
65
66
|
#
|
|
66
|
-
# Capabilities specific to the `textDocument/
|
|
67
|
+
# Capabilities specific to the `textDocument/declaration` request.
|
|
67
68
|
#
|
|
68
|
-
# @return [
|
|
69
|
-
def
|
|
70
|
-
attributes.fetch(:
|
|
69
|
+
# @return [DeclarationClientCapabilities]
|
|
70
|
+
def declaration
|
|
71
|
+
attributes.fetch(:declaration)
|
|
71
72
|
end
|
|
72
73
|
|
|
73
74
|
#
|
|
74
|
-
# Capabilities specific to the `textDocument/
|
|
75
|
+
# Capabilities specific to the `textDocument/definition` request.
|
|
75
76
|
#
|
|
76
|
-
# @return [
|
|
77
|
-
def
|
|
78
|
-
attributes.fetch(:
|
|
77
|
+
# @return [DefinitionClientCapabilities]
|
|
78
|
+
def definition
|
|
79
|
+
attributes.fetch(:definition)
|
|
79
80
|
end
|
|
80
81
|
|
|
81
82
|
#
|
|
82
|
-
# Capabilities specific to the `textDocument/
|
|
83
|
+
# Capabilities specific to the `textDocument/typeDefinition` request.
|
|
83
84
|
#
|
|
84
|
-
# @return [
|
|
85
|
-
def
|
|
86
|
-
attributes.fetch(:
|
|
85
|
+
# @return [TypeDefinitionClientCapabilities]
|
|
86
|
+
def type_definition
|
|
87
|
+
attributes.fetch(:typeDefinition)
|
|
87
88
|
end
|
|
88
89
|
|
|
89
90
|
#
|
|
90
|
-
# Capabilities specific to the `textDocument/
|
|
91
|
+
# Capabilities specific to the `textDocument/implementation` request.
|
|
91
92
|
#
|
|
92
|
-
# @return [
|
|
93
|
-
def
|
|
94
|
-
attributes.fetch(:
|
|
93
|
+
# @return [ImplementationClientCapabilities]
|
|
94
|
+
def implementation
|
|
95
|
+
attributes.fetch(:implementation)
|
|
95
96
|
end
|
|
96
97
|
|
|
97
98
|
#
|
|
98
|
-
# Capabilities specific to the `textDocument/
|
|
99
|
+
# Capabilities specific to the `textDocument/references` request.
|
|
99
100
|
#
|
|
100
|
-
# @return [
|
|
101
|
-
def
|
|
102
|
-
attributes.fetch(:
|
|
101
|
+
# @return [ReferenceClientCapabilities]
|
|
102
|
+
def references
|
|
103
|
+
attributes.fetch(:references)
|
|
103
104
|
end
|
|
104
105
|
|
|
105
106
|
#
|
|
106
|
-
# Capabilities specific to the `textDocument/
|
|
107
|
+
# Capabilities specific to the `textDocument/documentHighlight` request.
|
|
107
108
|
#
|
|
108
|
-
# @return [
|
|
109
|
-
def
|
|
110
|
-
attributes.fetch(:
|
|
109
|
+
# @return [DocumentHighlightClientCapabilities]
|
|
110
|
+
def document_highlight
|
|
111
|
+
attributes.fetch(:documentHighlight)
|
|
111
112
|
end
|
|
112
113
|
|
|
113
114
|
#
|
|
114
|
-
# Capabilities specific to the `textDocument/
|
|
115
|
+
# Capabilities specific to the `textDocument/documentSymbol` request.
|
|
115
116
|
#
|
|
116
|
-
# @return [
|
|
117
|
-
def
|
|
118
|
-
attributes.fetch(:
|
|
117
|
+
# @return [DocumentSymbolClientCapabilities]
|
|
118
|
+
def document_symbol
|
|
119
|
+
attributes.fetch(:documentSymbol)
|
|
119
120
|
end
|
|
120
121
|
|
|
121
122
|
#
|
|
122
|
-
# Capabilities specific to the `textDocument/
|
|
123
|
-
#
|
|
124
|
-
# Since 3.14.0
|
|
123
|
+
# Capabilities specific to the `textDocument/codeAction` request.
|
|
125
124
|
#
|
|
126
|
-
# @return [
|
|
127
|
-
def
|
|
128
|
-
attributes.fetch(:
|
|
125
|
+
# @return [CodeActionClientCapabilities]
|
|
126
|
+
def code_action
|
|
127
|
+
attributes.fetch(:codeAction)
|
|
129
128
|
end
|
|
130
129
|
|
|
131
130
|
#
|
|
132
|
-
# Capabilities specific to the `textDocument/
|
|
133
|
-
#
|
|
134
|
-
# Since 3.6.0
|
|
131
|
+
# Capabilities specific to the `textDocument/codeLens` request.
|
|
135
132
|
#
|
|
136
|
-
# @return [
|
|
137
|
-
def
|
|
138
|
-
attributes.fetch(:
|
|
133
|
+
# @return [CodeLensClientCapabilities]
|
|
134
|
+
def code_lens
|
|
135
|
+
attributes.fetch(:codeLens)
|
|
139
136
|
end
|
|
140
137
|
|
|
141
138
|
#
|
|
142
|
-
# Capabilities specific to the `textDocument/
|
|
143
|
-
#
|
|
144
|
-
# Since 3.6.0
|
|
139
|
+
# Capabilities specific to the `textDocument/documentLink` request.
|
|
145
140
|
#
|
|
146
|
-
# @return [
|
|
147
|
-
def
|
|
148
|
-
attributes.fetch(:
|
|
141
|
+
# @return [DocumentLinkClientCapabilities]
|
|
142
|
+
def document_link
|
|
143
|
+
attributes.fetch(:documentLink)
|
|
149
144
|
end
|
|
150
145
|
|
|
151
146
|
#
|
|
152
|
-
# Capabilities specific to the `textDocument/
|
|
147
|
+
# Capabilities specific to the `textDocument/documentColor` and the
|
|
148
|
+
# `textDocument/colorPresentation` request.
|
|
153
149
|
#
|
|
154
|
-
# @return [
|
|
155
|
-
def
|
|
156
|
-
attributes.fetch(:
|
|
150
|
+
# @return [DocumentColorClientCapabilities]
|
|
151
|
+
def color_provider
|
|
152
|
+
attributes.fetch(:colorProvider)
|
|
157
153
|
end
|
|
158
154
|
|
|
159
155
|
#
|
|
160
|
-
# Capabilities specific to the `textDocument/
|
|
156
|
+
# Capabilities specific to the `textDocument/formatting` request.
|
|
161
157
|
#
|
|
162
|
-
# @return [
|
|
163
|
-
def
|
|
164
|
-
attributes.fetch(:
|
|
158
|
+
# @return [DocumentFormattingClientCapabilities]
|
|
159
|
+
def formatting
|
|
160
|
+
attributes.fetch(:formatting)
|
|
165
161
|
end
|
|
166
162
|
|
|
167
163
|
#
|
|
168
|
-
# Capabilities specific to the `textDocument/
|
|
164
|
+
# Capabilities specific to the `textDocument/rangeFormatting` request.
|
|
169
165
|
#
|
|
170
|
-
# @return [
|
|
171
|
-
def
|
|
172
|
-
attributes.fetch(:
|
|
166
|
+
# @return [DocumentRangeFormattingClientCapabilities]
|
|
167
|
+
def range_formatting
|
|
168
|
+
attributes.fetch(:rangeFormatting)
|
|
173
169
|
end
|
|
174
170
|
|
|
175
171
|
#
|
|
176
|
-
#
|
|
177
|
-
# `textDocument/
|
|
178
|
-
#
|
|
179
|
-
# Since 3.6.0
|
|
172
|
+
# request.
|
|
173
|
+
# Capabilities specific to the `textDocument/onTypeFormatting` request.
|
|
180
174
|
#
|
|
181
|
-
# @return [
|
|
182
|
-
def
|
|
183
|
-
attributes.fetch(:
|
|
175
|
+
# @return [DocumentOnTypeFormattingClientCapabilities]
|
|
176
|
+
def on_type_formatting
|
|
177
|
+
attributes.fetch(:onTypeFormatting)
|
|
184
178
|
end
|
|
185
179
|
|
|
186
180
|
#
|
|
187
|
-
# Capabilities specific to the `textDocument/rename`
|
|
181
|
+
# Capabilities specific to the `textDocument/rename` request.
|
|
188
182
|
#
|
|
189
|
-
# @return [
|
|
183
|
+
# @return [RenameClientCapabilities]
|
|
190
184
|
def rename
|
|
191
185
|
attributes.fetch(:rename)
|
|
192
186
|
end
|
|
193
187
|
|
|
194
188
|
#
|
|
195
|
-
# Capabilities specific to `textDocument/publishDiagnostics
|
|
189
|
+
# Capabilities specific to the `textDocument/publishDiagnostics` notification.
|
|
196
190
|
#
|
|
197
|
-
# @return [
|
|
191
|
+
# @return [PublishDiagnosticsClientCapabilities]
|
|
198
192
|
def publish_diagnostics
|
|
199
193
|
attributes.fetch(:publishDiagnostics)
|
|
200
194
|
end
|
|
201
195
|
|
|
202
196
|
#
|
|
203
|
-
# Capabilities specific to `textDocument/foldingRange`
|
|
197
|
+
# Capabilities specific to the `textDocument/foldingRange` request.
|
|
204
198
|
#
|
|
205
|
-
#
|
|
206
|
-
#
|
|
207
|
-
# @return [{ dynamicRegistration?: boolean; rangeLimit?: number; lineFoldingOnly?: boolean; }]
|
|
199
|
+
# @return [FoldingRangeClientCapabilities]
|
|
208
200
|
def folding_range
|
|
209
201
|
attributes.fetch(:foldingRange)
|
|
210
202
|
end
|
|
211
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
|
+
|
|
212
212
|
attr_reader :attributes
|
|
213
213
|
|
|
214
214
|
def to_hash
|