language_server-protocol 3.7.0.0 → 3.15.0.0
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 +14 -0
- data/lib/language_server/protocol/constant/code_action_kind.rb +75 -0
- 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 +186 -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 +92 -0
- data/lib/language_server/protocol/interface/code_action_client_capabilities.rb +52 -0
- data/lib/language_server/protocol/interface/code_action_context.rb +18 -2
- data/lib/language_server/protocol/interface/code_action_options.rb +37 -0
- data/lib/language_server/protocol/interface/code_action_params.rb +3 -2
- data/lib/language_server/protocol/interface/code_action_registration_options.rb +26 -0
- 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 +29 -5
- data/lib/language_server/protocol/interface/completion_options.rb +33 -11
- data/lib/language_server/protocol/interface/completion_params.rb +4 -3
- 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/{color_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 +74 -0
- 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 +34 -0
- data/lib/language_server/protocol/interface/folding_range_registration_options.rb +25 -0
- 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 +34 -0
- data/lib/language_server/protocol/interface/rename_params.rb +3 -20
- data/lib/language_server/protocol/interface/rename_registration_options.rb +26 -0
- 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 +78 -53
- 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 +97 -75
- 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 +105 -29
- data/.gitignore +0 -10
- data/.travis.yml +0 -5
- data/CHANGELOG.md +0 -13
- 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 -27
- data/docker-compose.ci.yml +0 -14
- data/docker-compose.override.yml +0 -15
- data/docker-compose.yml +0 -31
- data/language_server-protocol.gemspec +0 -31
- data/lib/language_server/protocol/interface/text_document_content_change_event.rb +0 -55
- 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 -252
- data/yarn.lock +0 -293
@@ -2,10 +2,11 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
class ApplyWorkspaceEditResponse
|
5
|
-
def initialize(applied:)
|
5
|
+
def initialize(applied:, failure_reason: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
8
|
@attributes[:applied] = applied
|
9
|
+
@attributes[:failureReason] = failure_reason if failure_reason
|
9
10
|
|
10
11
|
@attributes.freeze
|
11
12
|
end
|
@@ -18,6 +19,17 @@ module LanguageServer
|
|
18
19
|
attributes.fetch(:applied)
|
19
20
|
end
|
20
21
|
|
22
|
+
#
|
23
|
+
# An optional textual description for why the edit was not applied.
|
24
|
+
# This may be used may be used by the server for diagnostic
|
25
|
+
# logging or to provide a suitable error for a request that
|
26
|
+
# triggered the edit.
|
27
|
+
#
|
28
|
+
# @return [string]
|
29
|
+
def failure_reason
|
30
|
+
attributes.fetch(:failureReason)
|
31
|
+
end
|
32
|
+
|
21
33
|
attr_reader :attributes
|
22
34
|
|
23
35
|
def to_hash
|
@@ -2,11 +2,12 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
class ClientCapabilities
|
5
|
-
def initialize(workspace: nil, text_document: nil, experimental: nil)
|
5
|
+
def initialize(workspace: nil, text_document: nil, window: nil, experimental: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
8
|
@attributes[:workspace] = workspace if workspace
|
9
9
|
@attributes[:textDocument] = text_document if text_document
|
10
|
+
@attributes[:window] = window if window
|
10
11
|
@attributes[:experimental] = experimental if experimental
|
11
12
|
|
12
13
|
@attributes.freeze
|
@@ -15,7 +16,7 @@ module LanguageServer
|
|
15
16
|
#
|
16
17
|
# Workspace specific client capabilities.
|
17
18
|
#
|
18
|
-
# @return [
|
19
|
+
# @return [{ applyEdit?: boolean; workspaceEdit?: WorkspaceEditClientCapabilities; didChangeConfiguration?: ...]
|
19
20
|
def workspace
|
20
21
|
attributes.fetch(:workspace)
|
21
22
|
end
|
@@ -28,6 +29,14 @@ module LanguageServer
|
|
28
29
|
attributes.fetch(:textDocument)
|
29
30
|
end
|
30
31
|
|
32
|
+
#
|
33
|
+
# Window specific client capabilities.
|
34
|
+
#
|
35
|
+
# @return [{ workDoneProgress?: boolean; }]
|
36
|
+
def window
|
37
|
+
attributes.fetch(:window)
|
38
|
+
end
|
39
|
+
|
31
40
|
#
|
32
41
|
# Experimental client capabilities.
|
33
42
|
#
|
@@ -0,0 +1,92 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A code action represents a change that can be performed in code, e.g. to fix a problem or
|
6
|
+
# to refactor code.
|
7
|
+
#
|
8
|
+
# A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed.
|
9
|
+
#
|
10
|
+
class CodeAction
|
11
|
+
def initialize(title:, kind: nil, diagnostics: nil, is_preferred: nil, edit: nil, command: nil)
|
12
|
+
@attributes = {}
|
13
|
+
|
14
|
+
@attributes[:title] = title
|
15
|
+
@attributes[:kind] = kind if kind
|
16
|
+
@attributes[:diagnostics] = diagnostics if diagnostics
|
17
|
+
@attributes[:isPreferred] = is_preferred if is_preferred
|
18
|
+
@attributes[:edit] = edit if edit
|
19
|
+
@attributes[:command] = command if command
|
20
|
+
|
21
|
+
@attributes.freeze
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# A short, human-readable, title for this code action.
|
26
|
+
#
|
27
|
+
# @return [string]
|
28
|
+
def title
|
29
|
+
attributes.fetch(:title)
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# The kind of the code action.
|
34
|
+
#
|
35
|
+
# Used to filter code actions.
|
36
|
+
#
|
37
|
+
# @return [string]
|
38
|
+
def kind
|
39
|
+
attributes.fetch(:kind)
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# The diagnostics that this code action resolves.
|
44
|
+
#
|
45
|
+
# @return [Diagnostic[]]
|
46
|
+
def diagnostics
|
47
|
+
attributes.fetch(:diagnostics)
|
48
|
+
end
|
49
|
+
|
50
|
+
#
|
51
|
+
# Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted
|
52
|
+
# by keybindings.
|
53
|
+
#
|
54
|
+
# A quick fix should be marked preferred if it properly addresses the underlying error.
|
55
|
+
# A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
|
56
|
+
#
|
57
|
+
# @return [boolean]
|
58
|
+
def is_preferred
|
59
|
+
attributes.fetch(:isPreferred)
|
60
|
+
end
|
61
|
+
|
62
|
+
#
|
63
|
+
# The workspace edit this code action performs.
|
64
|
+
#
|
65
|
+
# @return [WorkspaceEdit]
|
66
|
+
def edit
|
67
|
+
attributes.fetch(:edit)
|
68
|
+
end
|
69
|
+
|
70
|
+
#
|
71
|
+
# A command this code action executes. If a code action
|
72
|
+
# provides an edit and a command, first the edit is
|
73
|
+
# executed and then the command.
|
74
|
+
#
|
75
|
+
# @return [Command]
|
76
|
+
def command
|
77
|
+
attributes.fetch(:command)
|
78
|
+
end
|
79
|
+
|
80
|
+
attr_reader :attributes
|
81
|
+
|
82
|
+
def to_hash
|
83
|
+
attributes
|
84
|
+
end
|
85
|
+
|
86
|
+
def to_json(*args)
|
87
|
+
to_hash.to_json(*args)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class CodeActionClientCapabilities
|
5
|
+
def initialize(dynamic_registration: nil, code_action_literal_support: nil, is_preferred_support: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
|
9
|
+
@attributes[:codeActionLiteralSupport] = code_action_literal_support if code_action_literal_support
|
10
|
+
@attributes[:isPreferredSupport] = is_preferred_support if is_preferred_support
|
11
|
+
|
12
|
+
@attributes.freeze
|
13
|
+
end
|
14
|
+
|
15
|
+
#
|
16
|
+
# Whether code action supports dynamic registration.
|
17
|
+
#
|
18
|
+
# @return [boolean]
|
19
|
+
def dynamic_registration
|
20
|
+
attributes.fetch(:dynamicRegistration)
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# The client supports code action literals as a valid
|
25
|
+
# response of the `textDocument/codeAction` request.
|
26
|
+
#
|
27
|
+
# @return [{ codeActionKind: { valueSet: string[]; }; }]
|
28
|
+
def code_action_literal_support
|
29
|
+
attributes.fetch(:codeActionLiteralSupport)
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# Whether code action supports the `isPreferred` property.
|
34
|
+
#
|
35
|
+
# @return [boolean]
|
36
|
+
def is_preferred_support
|
37
|
+
attributes.fetch(:isPreferredSupport)
|
38
|
+
end
|
39
|
+
|
40
|
+
attr_reader :attributes
|
41
|
+
|
42
|
+
def to_hash
|
43
|
+
attributes
|
44
|
+
end
|
45
|
+
|
46
|
+
def to_json(*args)
|
47
|
+
to_hash.to_json(*args)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -6,22 +6,38 @@ module LanguageServer
|
|
6
6
|
# a code action is run.
|
7
7
|
#
|
8
8
|
class CodeActionContext
|
9
|
-
def initialize(diagnostics:)
|
9
|
+
def initialize(diagnostics:, only: nil)
|
10
10
|
@attributes = {}
|
11
11
|
|
12
12
|
@attributes[:diagnostics] = diagnostics
|
13
|
+
@attributes[:only] = only if only
|
13
14
|
|
14
15
|
@attributes.freeze
|
15
16
|
end
|
16
17
|
|
17
18
|
#
|
18
|
-
# An array of diagnostics
|
19
|
+
# An array of diagnostics known on the client side overlapping the range provided to the
|
20
|
+
# `textDocument/codeAction` request. They are provided so that the server knows which
|
21
|
+
# errors are currently presented to the user for the given range. There is no guarantee
|
22
|
+
# that these accurately reflect the error state of the resource. The primary parameter
|
23
|
+
# to compute code actions is the provided range.
|
19
24
|
#
|
20
25
|
# @return [Diagnostic[]]
|
21
26
|
def diagnostics
|
22
27
|
attributes.fetch(:diagnostics)
|
23
28
|
end
|
24
29
|
|
30
|
+
#
|
31
|
+
# Requested kind of actions to return.
|
32
|
+
#
|
33
|
+
# Actions not of this kind are filtered out by the client before being shown. So servers
|
34
|
+
# can omit computing them.
|
35
|
+
#
|
36
|
+
# @return [string[]]
|
37
|
+
def only
|
38
|
+
attributes.fetch(:only)
|
39
|
+
end
|
40
|
+
|
25
41
|
attr_reader :attributes
|
26
42
|
|
27
43
|
def to_hash
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class CodeActionOptions < WorkDoneProgressOptions
|
5
|
+
def initialize(work_done_progress: nil, code_action_kinds: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
9
|
+
@attributes[:codeActionKinds] = code_action_kinds if code_action_kinds
|
10
|
+
|
11
|
+
@attributes.freeze
|
12
|
+
end
|
13
|
+
|
14
|
+
#
|
15
|
+
# CodeActionKinds that this server may return.
|
16
|
+
#
|
17
|
+
# The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server
|
18
|
+
# may list out every specific kind they provide.
|
19
|
+
#
|
20
|
+
# @return [string[]]
|
21
|
+
def code_action_kinds
|
22
|
+
attributes.fetch(:codeActionKinds)
|
23
|
+
end
|
24
|
+
|
25
|
+
attr_reader :attributes
|
26
|
+
|
27
|
+
def to_hash
|
28
|
+
attributes
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_json(*args)
|
32
|
+
to_hash.to_json(*args)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -4,10 +4,11 @@ module LanguageServer
|
|
4
4
|
#
|
5
5
|
# Params for the CodeActionRequest
|
6
6
|
#
|
7
|
-
class CodeActionParams
|
8
|
-
def initialize(text_document:, range:, context:)
|
7
|
+
class CodeActionParams < PartialResultParams
|
8
|
+
def initialize(partial_result_token: nil, text_document:, range:, context:)
|
9
9
|
@attributes = {}
|
10
10
|
|
11
|
+
@attributes[:partialResultToken] = partial_result_token if partial_result_token
|
11
12
|
@attributes[:textDocument] = text_document
|
12
13
|
@attributes[:range] = range
|
13
14
|
@attributes[:context] = context
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class CodeActionRegistrationOptions < CodeActionOptions
|
5
|
+
def initialize(work_done_progress: nil, code_action_kinds: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
9
|
+
@attributes[:codeActionKinds] = code_action_kinds if code_action_kinds
|
10
|
+
|
11
|
+
@attributes.freeze
|
12
|
+
end
|
13
|
+
|
14
|
+
attr_reader :attributes
|
15
|
+
|
16
|
+
def to_hash
|
17
|
+
attributes
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_json(*args)
|
21
|
+
to_hash.to_json(*args)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class CodeLensClientCapabilities
|
5
|
+
def initialize(dynamic_registration: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
|
9
|
+
|
10
|
+
@attributes.freeze
|
11
|
+
end
|
12
|
+
|
13
|
+
#
|
14
|
+
# Whether code lens supports dynamic registration.
|
15
|
+
#
|
16
|
+
# @return [boolean]
|
17
|
+
def dynamic_registration
|
18
|
+
attributes.fetch(:dynamicRegistration)
|
19
|
+
end
|
20
|
+
|
21
|
+
attr_reader :attributes
|
22
|
+
|
23
|
+
def to_hash
|
24
|
+
attributes
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_json(*args)
|
28
|
+
to_hash.to_json(*args)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -1,13 +1,11 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
|
5
|
-
|
6
|
-
#
|
7
|
-
class CodeLensOptions
|
8
|
-
def initialize(resolve_provider: nil)
|
4
|
+
class CodeLensOptions < WorkDoneProgressOptions
|
5
|
+
def initialize(work_done_progress: nil, resolve_provider: nil)
|
9
6
|
@attributes = {}
|
10
7
|
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
11
9
|
@attributes[:resolveProvider] = resolve_provider if resolve_provider
|
12
10
|
|
13
11
|
@attributes.freeze
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class CodeLensParams
|
5
|
-
def initialize(text_document:)
|
4
|
+
class CodeLensParams < PartialResultParams
|
5
|
+
def initialize(partial_result_token: nil, text_document:)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:partialResultToken] = partial_result_token if partial_result_token
|
8
9
|
@attributes[:textDocument] = text_document
|
9
10
|
|
10
11
|
@attributes.freeze
|
@@ -1,23 +1,16 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class CodeLensRegistrationOptions <
|
5
|
-
def initialize(
|
4
|
+
class CodeLensRegistrationOptions < CodeLensOptions
|
5
|
+
def initialize(work_done_progress: nil, resolve_provider: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
8
9
|
@attributes[:resolveProvider] = resolve_provider if resolve_provider
|
9
10
|
|
10
11
|
@attributes.freeze
|
11
12
|
end
|
12
13
|
|
13
|
-
#
|
14
|
-
# Code lens has a resolve provider as well.
|
15
|
-
#
|
16
|
-
# @return [boolean]
|
17
|
-
def resolve_provider
|
18
|
-
attributes.fetch(:resolveProvider)
|
19
|
-
end
|
20
|
-
|
21
14
|
attr_reader :attributes
|
22
15
|
|
23
16
|
def to_hash
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module LanguageServer
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
|
-
class ColorPresentationParams
|
5
|
-
def initialize(text_document:, color:, range:)
|
4
|
+
class ColorPresentationParams < PartialResultParams
|
5
|
+
def initialize(partial_result_token: nil, text_document:, color:, range:)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:partialResultToken] = partial_result_token if partial_result_token
|
8
9
|
@attributes[:textDocument] = text_document
|
9
10
|
@attributes[:color] = color
|
10
11
|
@attributes[:range] = range
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
class CompletionClientCapabilities
|
5
|
+
def initialize(dynamic_registration: nil, completion_item: nil, completion_item_kind: nil, context_support: nil)
|
6
|
+
@attributes = {}
|
7
|
+
|
8
|
+
@attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
|
9
|
+
@attributes[:completionItem] = completion_item if completion_item
|
10
|
+
@attributes[:completionItemKind] = completion_item_kind if completion_item_kind
|
11
|
+
@attributes[:contextSupport] = context_support if context_support
|
12
|
+
|
13
|
+
@attributes.freeze
|
14
|
+
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# Whether completion supports dynamic registration.
|
18
|
+
#
|
19
|
+
# @return [boolean]
|
20
|
+
def dynamic_registration
|
21
|
+
attributes.fetch(:dynamicRegistration)
|
22
|
+
end
|
23
|
+
|
24
|
+
#
|
25
|
+
# The client supports the following `CompletionItem` specific
|
26
|
+
# capabilities.
|
27
|
+
#
|
28
|
+
# @return [{ snippetSupport?: boolean; commitCharactersSupport?: boolean; documentationFormat?: MarkupKind[]...]
|
29
|
+
def completion_item
|
30
|
+
attributes.fetch(:completionItem)
|
31
|
+
end
|
32
|
+
|
33
|
+
# @return [{ valueSet?: any[]; }]
|
34
|
+
def completion_item_kind
|
35
|
+
attributes.fetch(:completionItemKind)
|
36
|
+
end
|
37
|
+
|
38
|
+
#
|
39
|
+
# The client supports to send additional context information for a
|
40
|
+
# `textDocument/completion` request.
|
41
|
+
#
|
42
|
+
# @return [boolean]
|
43
|
+
def context_support
|
44
|
+
attributes.fetch(:contextSupport)
|
45
|
+
end
|
46
|
+
|
47
|
+
attr_reader :attributes
|
48
|
+
|
49
|
+
def to_hash
|
50
|
+
attributes
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_json(*args)
|
54
|
+
to_hash.to_json(*args)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|