language_server-protocol 0.5.0 → 3.7.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 +5 -5
- data/CHANGELOG.md +4 -0
- data/README.md +13 -7
- data/lib/language_server/protocol/constant.rb +35 -11
- data/lib/language_server/protocol/constant/completion_item_kind.rb +7 -0
- data/lib/language_server/protocol/constant/completion_trigger_kind.rb +25 -0
- data/lib/language_server/protocol/constant/insert_text_format.rb +0 -2
- data/lib/language_server/protocol/constant/markup_kind.rb +23 -0
- data/lib/language_server/protocol/constant/symbol_kind.rb +8 -0
- data/lib/language_server/protocol/constant/watch_kind.rb +20 -0
- data/lib/language_server/protocol/interface.rb +217 -87
- data/lib/language_server/protocol/interface/apply_workspace_edit_params.rb +12 -1
- data/lib/language_server/protocol/interface/client_capabilities.rb +1 -1
- data/lib/language_server/protocol/interface/color.rb +63 -0
- data/lib/language_server/protocol/interface/color_information.rb +42 -0
- data/lib/language_server/protocol/interface/color_presentation.rb +56 -0
- data/lib/language_server/protocol/interface/color_presentation_params.rb +51 -0
- data/lib/language_server/protocol/interface/color_provider_options.rb +27 -0
- data/lib/language_server/protocol/interface/completion_context.rb +46 -0
- data/lib/language_server/protocol/interface/completion_item.rb +37 -6
- data/lib/language_server/protocol/interface/completion_params.rb +34 -0
- data/lib/language_server/protocol/interface/completion_registration_options.rb +8 -1
- data/lib/language_server/protocol/interface/configuration_item.rb +42 -0
- data/lib/language_server/protocol/interface/configuration_params.rb +30 -0
- data/lib/language_server/protocol/interface/diagnostic.rb +12 -2
- data/lib/language_server/protocol/interface/diagnostic_related_information.rb +47 -0
- data/lib/language_server/protocol/interface/did_change_text_document_params.rb +3 -1
- data/lib/language_server/protocol/interface/did_change_watched_files_registration_options.rb +36 -0
- data/lib/language_server/protocol/interface/did_change_workspace_folders_params.rb +33 -0
- data/lib/language_server/protocol/interface/did_save_text_document_params.rb +1 -1
- data/lib/language_server/protocol/interface/document_link.rb +11 -1
- data/lib/language_server/protocol/interface/file_system_watcher.rb +44 -0
- data/lib/language_server/protocol/interface/hover.rb +1 -1
- data/lib/language_server/protocol/interface/initialize_params.rb +15 -1
- data/lib/language_server/protocol/interface/initialized_params.rb +24 -0
- data/lib/language_server/protocol/interface/markup_content.rb +66 -0
- data/lib/language_server/protocol/interface/notification_message.rb +1 -1
- data/lib/language_server/protocol/interface/parameter_information.rb +1 -1
- data/lib/language_server/protocol/interface/position.rb +6 -1
- data/lib/language_server/protocol/interface/registration.rb +1 -1
- data/lib/language_server/protocol/interface/rename_params.rb +1 -1
- data/lib/language_server/protocol/interface/request_message.rb +1 -1
- data/lib/language_server/protocol/interface/server_capabilities.rb +44 -2
- data/lib/language_server/protocol/interface/signature_help.rb +2 -2
- data/lib/language_server/protocol/interface/signature_information.rb +1 -1
- data/lib/language_server/protocol/interface/static_registration_options.rb +37 -0
- data/lib/language_server/protocol/interface/symbol_information.rb +23 -3
- data/lib/language_server/protocol/interface/text_document_change_registration_options.rb +2 -2
- data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +48 -5
- data/lib/language_server/protocol/interface/text_document_item.rb +1 -1
- data/lib/language_server/protocol/interface/text_document_sync_options.rb +2 -2
- data/lib/language_server/protocol/interface/versioned_text_document_identifier.rb +5 -1
- data/lib/language_server/protocol/interface/workspace_client_capabilities.rb +104 -0
- data/lib/language_server/protocol/interface/workspace_edit.rb +4 -3
- data/lib/language_server/protocol/interface/workspace_folder.rb +43 -0
- data/lib/language_server/protocol/interface/workspace_folders_change_event.rb +45 -0
- data/lib/language_server/protocol/version.rb +1 -1
- data/scripts/generateFiles.ts +29 -9
- metadata +25 -3
@@ -20,7 +20,12 @@ module LanguageServer
|
|
20
20
|
end
|
21
21
|
|
22
22
|
#
|
23
|
-
# Character offset on a line in a document (zero-based).
|
23
|
+
# Character offset on a line in a document (zero-based). Assuming that the line is
|
24
|
+
# represented as a string, the `character` value represents the gap between the
|
25
|
+
# `character` and `character + 1`.
|
26
|
+
#
|
27
|
+
# If the character value is greater than the line length it defaults back to the
|
28
|
+
# line length.
|
24
29
|
#
|
25
30
|
# @return [number]
|
26
31
|
def character
|
@@ -2,7 +2,7 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
class ServerCapabilities
|
5
|
-
def initialize(text_document_sync: nil, hover_provider: nil, completion_provider: nil, signature_help_provider: nil, definition_provider: nil, references_provider: nil, document_highlight_provider: nil, document_symbol_provider: nil, workspace_symbol_provider: nil, code_action_provider: nil, code_lens_provider: nil, document_formatting_provider: nil, document_range_formatting_provider: nil, document_on_type_formatting_provider: nil, rename_provider: nil, document_link_provider: nil, execute_command_provider: nil, experimental: nil)
|
5
|
+
def initialize(text_document_sync: nil, hover_provider: nil, completion_provider: nil, signature_help_provider: nil, definition_provider: nil, type_definition_provider: nil, implementation_provider: nil, references_provider: nil, document_highlight_provider: nil, document_symbol_provider: nil, workspace_symbol_provider: nil, code_action_provider: nil, code_lens_provider: nil, document_formatting_provider: nil, document_range_formatting_provider: nil, document_on_type_formatting_provider: nil, rename_provider: nil, document_link_provider: nil, color_provider: nil, execute_command_provider: nil, workspace: nil, experimental: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
8
|
@attributes[:textDocumentSync] = text_document_sync if text_document_sync
|
@@ -10,6 +10,8 @@ module LanguageServer
|
|
10
10
|
@attributes[:completionProvider] = completion_provider if completion_provider
|
11
11
|
@attributes[:signatureHelpProvider] = signature_help_provider if signature_help_provider
|
12
12
|
@attributes[:definitionProvider] = definition_provider if definition_provider
|
13
|
+
@attributes[:typeDefinitionProvider] = type_definition_provider if type_definition_provider
|
14
|
+
@attributes[:implementationProvider] = implementation_provider if implementation_provider
|
13
15
|
@attributes[:referencesProvider] = references_provider if references_provider
|
14
16
|
@attributes[:documentHighlightProvider] = document_highlight_provider if document_highlight_provider
|
15
17
|
@attributes[:documentSymbolProvider] = document_symbol_provider if document_symbol_provider
|
@@ -21,7 +23,9 @@ module LanguageServer
|
|
21
23
|
@attributes[:documentOnTypeFormattingProvider] = document_on_type_formatting_provider if document_on_type_formatting_provider
|
22
24
|
@attributes[:renameProvider] = rename_provider if rename_provider
|
23
25
|
@attributes[:documentLinkProvider] = document_link_provider if document_link_provider
|
26
|
+
@attributes[:colorProvider] = color_provider if color_provider
|
24
27
|
@attributes[:executeCommandProvider] = execute_command_provider if execute_command_provider
|
28
|
+
@attributes[:workspace] = workspace if workspace
|
25
29
|
@attributes[:experimental] = experimental if experimental
|
26
30
|
|
27
31
|
@attributes.freeze
|
@@ -29,7 +33,7 @@ module LanguageServer
|
|
29
33
|
|
30
34
|
#
|
31
35
|
# Defines how text documents are synced. Is either a detailed structure defining each notification or
|
32
|
-
# for backwards compatibility the TextDocumentSyncKind number.
|
36
|
+
# for backwards compatibility the TextDocumentSyncKind number. If omitted it defaults to `TextDocumentSyncKind.None`.
|
33
37
|
#
|
34
38
|
# @return [number | TextDocumentSyncOptions]
|
35
39
|
def text_document_sync
|
@@ -68,6 +72,26 @@ module LanguageServer
|
|
68
72
|
attributes.fetch(:definitionProvider)
|
69
73
|
end
|
70
74
|
|
75
|
+
#
|
76
|
+
# The server provides Goto Type Definition support.
|
77
|
+
#
|
78
|
+
# Since 3.6.0
|
79
|
+
#
|
80
|
+
# @return [boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions)]
|
81
|
+
def type_definition_provider
|
82
|
+
attributes.fetch(:typeDefinitionProvider)
|
83
|
+
end
|
84
|
+
|
85
|
+
#
|
86
|
+
# The server provides Goto Implementation support.
|
87
|
+
#
|
88
|
+
# Since 3.6.0
|
89
|
+
#
|
90
|
+
# @return [boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions)]
|
91
|
+
def implementation_provider
|
92
|
+
attributes.fetch(:implementationProvider)
|
93
|
+
end
|
94
|
+
|
71
95
|
#
|
72
96
|
# The server provides find references support.
|
73
97
|
#
|
@@ -156,6 +180,16 @@ module LanguageServer
|
|
156
180
|
attributes.fetch(:documentLinkProvider)
|
157
181
|
end
|
158
182
|
|
183
|
+
#
|
184
|
+
# The server provides color provider support.
|
185
|
+
#
|
186
|
+
# Since 3.6.0
|
187
|
+
#
|
188
|
+
# @return [boolean | ColorProviderOptions | (ColorProviderOptions & TextDocumentRegistrationOptions & Static...]
|
189
|
+
def color_provider
|
190
|
+
attributes.fetch(:colorProvider)
|
191
|
+
end
|
192
|
+
|
159
193
|
#
|
160
194
|
# The server provides execute command support.
|
161
195
|
#
|
@@ -164,6 +198,14 @@ module LanguageServer
|
|
164
198
|
attributes.fetch(:executeCommandProvider)
|
165
199
|
end
|
166
200
|
|
201
|
+
#
|
202
|
+
# Workspace specific server capabilities
|
203
|
+
#
|
204
|
+
# @return [{ workspaceFolders?: { supported?: boolean; changeNotifications?: string | boolean; }; }]
|
205
|
+
def workspace
|
206
|
+
attributes.fetch(:workspace)
|
207
|
+
end
|
208
|
+
|
167
209
|
#
|
168
210
|
# Experimental server capabilities.
|
169
211
|
#
|
@@ -32,7 +32,7 @@ module LanguageServer
|
|
32
32
|
# make an active decision about the active signature and shouldn't
|
33
33
|
# rely on a default value.
|
34
34
|
# In future version of the protocol this property might become
|
35
|
-
#
|
35
|
+
# mandatory to better express this.
|
36
36
|
#
|
37
37
|
# @return [number]
|
38
38
|
def active_signature
|
@@ -45,7 +45,7 @@ module LanguageServer
|
|
45
45
|
# defaults to 0 if the active signature has parameters. If
|
46
46
|
# the active signature has no parameters it is ignored.
|
47
47
|
# In future version of the protocol this property might become
|
48
|
-
#
|
48
|
+
# mandatory to better express the active parameter if the
|
49
49
|
# active signature does have any.
|
50
50
|
#
|
51
51
|
# @return [number]
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Static registration options to be returned in the initialize request.
|
6
|
+
#
|
7
|
+
class StaticRegistrationOptions
|
8
|
+
def initialize(id: nil)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:id] = id if id
|
12
|
+
|
13
|
+
@attributes.freeze
|
14
|
+
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# The id used to register the request. The id can be used to deregister
|
18
|
+
# the request again. See also Registration#id.
|
19
|
+
#
|
20
|
+
# @return [string]
|
21
|
+
def id
|
22
|
+
attributes.fetch(:id)
|
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
|
@@ -6,11 +6,12 @@ module LanguageServer
|
|
6
6
|
# interfaces etc.
|
7
7
|
#
|
8
8
|
class SymbolInformation
|
9
|
-
def initialize(name:, kind:, location:, container_name: nil)
|
9
|
+
def initialize(name:, kind:, deprecated: nil, location:, container_name: nil)
|
10
10
|
@attributes = {}
|
11
11
|
|
12
12
|
@attributes[:name] = name
|
13
13
|
@attributes[:kind] = kind
|
14
|
+
@attributes[:deprecated] = deprecated if deprecated
|
14
15
|
@attributes[:location] = location
|
15
16
|
@attributes[:containerName] = container_name if container_name
|
16
17
|
|
@@ -34,7 +35,23 @@ module LanguageServer
|
|
34
35
|
end
|
35
36
|
|
36
37
|
#
|
37
|
-
#
|
38
|
+
# Indicates if this symbol is deprecated.
|
39
|
+
#
|
40
|
+
# @return [boolean]
|
41
|
+
def deprecated
|
42
|
+
attributes.fetch(:deprecated)
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# The location of this symbol. The location's range is used by a tool
|
47
|
+
# to reveal the location in the editor. If the symbol is selected in the
|
48
|
+
# tool the range's start information is used to position the cursor. So
|
49
|
+
# the range usually spans more then the actual symbol's name and does
|
50
|
+
# normally include things like visibility modifiers.
|
51
|
+
#
|
52
|
+
# The range doesn't have to denote a node range in the sense of a abstract
|
53
|
+
# syntax tree. It can therefore not be used to re-construct a hierarchy of
|
54
|
+
# the symbols.
|
38
55
|
#
|
39
56
|
# @return [Location]
|
40
57
|
def location
|
@@ -42,7 +59,10 @@ module LanguageServer
|
|
42
59
|
end
|
43
60
|
|
44
61
|
#
|
45
|
-
# The name of the symbol containing this symbol.
|
62
|
+
# The name of the symbol containing this symbol. This information is for
|
63
|
+
# user interface purposes (e.g. to render a qualifier in the user interface
|
64
|
+
# if necessary). It can't be used to re-infer a hierarchy for the document
|
65
|
+
# symbols.
|
46
66
|
#
|
47
67
|
# @return [string]
|
48
68
|
def container_name
|
@@ -2,7 +2,7 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
#
|
5
|
-
#
|
5
|
+
# Describe options to be used when registering for text document change events.
|
6
6
|
#
|
7
7
|
class TextDocumentChangeRegistrationOptions < TextDocumentRegistrationOptions
|
8
8
|
def initialize(document_selector:, sync_kind:)
|
@@ -15,7 +15,7 @@ module LanguageServer
|
|
15
15
|
|
16
16
|
#
|
17
17
|
# How documents are synced to the server. See TextDocumentSyncKind.Full
|
18
|
-
# and
|
18
|
+
# and TextDocumentSyncKind.Incremental.
|
19
19
|
#
|
20
20
|
# @return [number]
|
21
21
|
def sync_kind
|
@@ -5,7 +5,7 @@ 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, references: nil, document_highlight: nil, document_symbol: nil, formatting: nil, range_formatting: nil, on_type_formatting: nil, definition: nil, code_action: nil, code_lens: nil, document_link: nil, rename: nil)
|
8
|
+
def initialize(synchronization: nil, completion: nil, hover: nil, signature_help: nil, references: nil, document_highlight: nil, document_symbol: nil, formatting: nil, range_formatting: nil, on_type_formatting: nil, definition: nil, type_definition: nil, implementation: nil, code_action: nil, code_lens: nil, document_link: nil, color_provider: nil, rename: nil, publish_diagnostics: nil)
|
9
9
|
@attributes = {}
|
10
10
|
|
11
11
|
@attributes[:synchronization] = synchronization if synchronization
|
@@ -19,10 +19,14 @@ module LanguageServer
|
|
19
19
|
@attributes[:rangeFormatting] = range_formatting if range_formatting
|
20
20
|
@attributes[:onTypeFormatting] = on_type_formatting if on_type_formatting
|
21
21
|
@attributes[:definition] = definition if definition
|
22
|
+
@attributes[:typeDefinition] = type_definition if type_definition
|
23
|
+
@attributes[:implementation] = implementation if implementation
|
22
24
|
@attributes[:codeAction] = code_action if code_action
|
23
25
|
@attributes[:codeLens] = code_lens if code_lens
|
24
26
|
@attributes[:documentLink] = document_link if document_link
|
27
|
+
@attributes[:colorProvider] = color_provider if color_provider
|
25
28
|
@attributes[:rename] = rename if rename
|
29
|
+
@attributes[:publishDiagnostics] = publish_diagnostics if publish_diagnostics
|
26
30
|
|
27
31
|
@attributes.freeze
|
28
32
|
end
|
@@ -35,7 +39,7 @@ module LanguageServer
|
|
35
39
|
#
|
36
40
|
# Capabilities specific to the `textDocument/completion`
|
37
41
|
#
|
38
|
-
# @return [{ dynamicRegistration?: boolean; completionItem?: { snippetSupport?: boolean;
|
42
|
+
# @return [{ dynamicRegistration?: boolean; completionItem?: { snippetSupport?: boolean; commitCharactersSup...]
|
39
43
|
def completion
|
40
44
|
attributes.fetch(:completion)
|
41
45
|
end
|
@@ -43,7 +47,7 @@ module LanguageServer
|
|
43
47
|
#
|
44
48
|
# Capabilities specific to the `textDocument/hover`
|
45
49
|
#
|
46
|
-
# @return [{ dynamicRegistration?: boolean; }]
|
50
|
+
# @return [{ dynamicRegistration?: boolean; contentFormat?: MarkupKind[]; }]
|
47
51
|
def hover
|
48
52
|
attributes.fetch(:hover)
|
49
53
|
end
|
@@ -51,7 +55,7 @@ module LanguageServer
|
|
51
55
|
#
|
52
56
|
# Capabilities specific to the `textDocument/signatureHelp`
|
53
57
|
#
|
54
|
-
# @return [{ dynamicRegistration?: boolean; }]
|
58
|
+
# @return [{ dynamicRegistration?: boolean; signatureInformation?: { documentationFormat?: MarkupKind[]; }; }]
|
55
59
|
def signature_help
|
56
60
|
attributes.fetch(:signatureHelp)
|
57
61
|
end
|
@@ -75,7 +79,7 @@ module LanguageServer
|
|
75
79
|
#
|
76
80
|
# Capabilities specific to the `textDocument/documentSymbol`
|
77
81
|
#
|
78
|
-
# @return [{ dynamicRegistration?: boolean; }]
|
82
|
+
# @return [{ dynamicRegistration?: boolean; symbolKind?: { valueSet?: any[]; }; }]
|
79
83
|
def document_symbol
|
80
84
|
attributes.fetch(:documentSymbol)
|
81
85
|
end
|
@@ -112,6 +116,26 @@ module LanguageServer
|
|
112
116
|
attributes.fetch(:definition)
|
113
117
|
end
|
114
118
|
|
119
|
+
#
|
120
|
+
# Capabilities specific to the `textDocument/typeDefinition`
|
121
|
+
#
|
122
|
+
# Since 3.6.0
|
123
|
+
#
|
124
|
+
# @return [{ dynamicRegistration?: boolean; }]
|
125
|
+
def type_definition
|
126
|
+
attributes.fetch(:typeDefinition)
|
127
|
+
end
|
128
|
+
|
129
|
+
#
|
130
|
+
# Capabilities specific to the `textDocument/implementation`.
|
131
|
+
#
|
132
|
+
# Since 3.6.0
|
133
|
+
#
|
134
|
+
# @return [{ dynamicRegistration?: boolean; }]
|
135
|
+
def implementation
|
136
|
+
attributes.fetch(:implementation)
|
137
|
+
end
|
138
|
+
|
115
139
|
#
|
116
140
|
# Capabilities specific to the `textDocument/codeAction`
|
117
141
|
#
|
@@ -136,6 +160,17 @@ module LanguageServer
|
|
136
160
|
attributes.fetch(:documentLink)
|
137
161
|
end
|
138
162
|
|
163
|
+
#
|
164
|
+
# Capabilities specific to the `textDocument/documentColor` and the
|
165
|
+
# `textDocument/colorPresentation` request.
|
166
|
+
#
|
167
|
+
# Since 3.6.0
|
168
|
+
#
|
169
|
+
# @return [{ dynamicRegistration?: boolean; }]
|
170
|
+
def color_provider
|
171
|
+
attributes.fetch(:colorProvider)
|
172
|
+
end
|
173
|
+
|
139
174
|
#
|
140
175
|
# Capabilities specific to the `textDocument/rename`
|
141
176
|
#
|
@@ -144,6 +179,14 @@ module LanguageServer
|
|
144
179
|
attributes.fetch(:rename)
|
145
180
|
end
|
146
181
|
|
182
|
+
#
|
183
|
+
# Capabilities specific to `textDocument/publishDiagnostics`.
|
184
|
+
#
|
185
|
+
# @return [{ relatedInformation?: boolean; }]
|
186
|
+
def publish_diagnostics
|
187
|
+
attributes.fetch(:publishDiagnostics)
|
188
|
+
end
|
189
|
+
|
147
190
|
attr_reader :attributes
|
148
191
|
|
149
192
|
def to_hash
|
@@ -23,8 +23,8 @@ module LanguageServer
|
|
23
23
|
end
|
24
24
|
|
25
25
|
#
|
26
|
-
# Change
|
27
|
-
# and
|
26
|
+
# Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
|
27
|
+
# and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.
|
28
28
|
#
|
29
29
|
# @return [number]
|
30
30
|
def change
|
@@ -11,7 +11,11 @@ module LanguageServer
|
|
11
11
|
end
|
12
12
|
|
13
13
|
#
|
14
|
-
# The version number of this document.
|
14
|
+
# The version number of this document. If a versioned text document identifier
|
15
|
+
# is sent from the server to the client and the file is not open in the editor
|
16
|
+
# (the server has not received an open notification before) the server can send
|
17
|
+
# `null` to indicate that the version is known and the content on disk is the
|
18
|
+
# truth (as speced with document content ownership)
|
15
19
|
#
|
16
20
|
# @return [number]
|
17
21
|
def version
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Workspace specific client capabilities.
|
6
|
+
#
|
7
|
+
class WorkspaceClientCapabilities
|
8
|
+
def initialize(apply_edit: nil, workspace_edit: nil, did_change_configuration: nil, did_change_watched_files: nil, symbol: nil, execute_command: nil, workspace_folders: nil, configuration: nil)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:applyEdit] = apply_edit if apply_edit
|
12
|
+
@attributes[:workspaceEdit] = workspace_edit if workspace_edit
|
13
|
+
@attributes[:didChangeConfiguration] = did_change_configuration if did_change_configuration
|
14
|
+
@attributes[:didChangeWatchedFiles] = did_change_watched_files if did_change_watched_files
|
15
|
+
@attributes[:symbol] = symbol if symbol
|
16
|
+
@attributes[:executeCommand] = execute_command if execute_command
|
17
|
+
@attributes[:workspaceFolders] = workspace_folders if workspace_folders
|
18
|
+
@attributes[:configuration] = configuration if configuration
|
19
|
+
|
20
|
+
@attributes.freeze
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# The client supports applying batch edits to the workspace by supporting
|
25
|
+
# the request 'workspace/applyEdit'
|
26
|
+
#
|
27
|
+
# @return [boolean]
|
28
|
+
def apply_edit
|
29
|
+
attributes.fetch(:applyEdit)
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# Capabilities specific to `WorkspaceEdit`s
|
34
|
+
#
|
35
|
+
# @return [{ documentChanges?: boolean; }]
|
36
|
+
def workspace_edit
|
37
|
+
attributes.fetch(:workspaceEdit)
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Capabilities specific to the `workspace/didChangeConfiguration` notification.
|
42
|
+
#
|
43
|
+
# @return [{ dynamicRegistration?: boolean; }]
|
44
|
+
def did_change_configuration
|
45
|
+
attributes.fetch(:didChangeConfiguration)
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
|
50
|
+
#
|
51
|
+
# @return [{ dynamicRegistration?: boolean; }]
|
52
|
+
def did_change_watched_files
|
53
|
+
attributes.fetch(:didChangeWatchedFiles)
|
54
|
+
end
|
55
|
+
|
56
|
+
#
|
57
|
+
# Capabilities specific to the `workspace/symbol` request.
|
58
|
+
#
|
59
|
+
# @return [{ dynamicRegistration?: boolean; symbolKind?: { valueSet?: any[]; }; }]
|
60
|
+
def symbol
|
61
|
+
attributes.fetch(:symbol)
|
62
|
+
end
|
63
|
+
|
64
|
+
#
|
65
|
+
# Capabilities specific to the `workspace/executeCommand` request.
|
66
|
+
#
|
67
|
+
# @return [{ dynamicRegistration?: boolean; }]
|
68
|
+
def execute_command
|
69
|
+
attributes.fetch(:executeCommand)
|
70
|
+
end
|
71
|
+
|
72
|
+
#
|
73
|
+
# The client has support for workspace folders.
|
74
|
+
#
|
75
|
+
# Since 3.6.0
|
76
|
+
#
|
77
|
+
# @return [boolean]
|
78
|
+
def workspace_folders
|
79
|
+
attributes.fetch(:workspaceFolders)
|
80
|
+
end
|
81
|
+
|
82
|
+
#
|
83
|
+
# The client supports `workspace/configuration` requests.
|
84
|
+
#
|
85
|
+
# Since 3.6.0
|
86
|
+
#
|
87
|
+
# @return [boolean]
|
88
|
+
def configuration
|
89
|
+
attributes.fetch(:configuration)
|
90
|
+
end
|
91
|
+
|
92
|
+
attr_reader :attributes
|
93
|
+
|
94
|
+
def to_hash
|
95
|
+
attributes
|
96
|
+
end
|
97
|
+
|
98
|
+
def to_json(*args)
|
99
|
+
to_hash.to_json(*args)
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|