language_server 0.1.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 +7 -0
- data/.gitignore +11 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Dockerfile +13 -0
- data/Dockerfile.production +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +10 -0
- data/bin/console +11 -0
- data/bin/generate_files +3 -0
- data/bin/setup +8 -0
- data/docker-compose.yml +20 -0
- data/exe/language_server +8 -0
- data/language_server.gemspec +28 -0
- data/lib/language_server/protocol/constants/completion_item_kind.rb +29 -0
- data/lib/language_server/protocol/constants/diagnostic_severity.rb +24 -0
- data/lib/language_server/protocol/constants/document_highlight_kind.rb +23 -0
- data/lib/language_server/protocol/constants/error_codes.rb +18 -0
- data/lib/language_server/protocol/constants/file_change_type.rb +23 -0
- data/lib/language_server/protocol/constants/initialize_error.rb +15 -0
- data/lib/language_server/protocol/constants/insert_text_format.rb +27 -0
- data/lib/language_server/protocol/constants/message_type.rb +24 -0
- data/lib/language_server/protocol/constants/symbol_kind.rb +29 -0
- data/lib/language_server/protocol/constants/text_document_save_reason.rb +24 -0
- data/lib/language_server/protocol/constants/text_document_sync_kind.rb +26 -0
- data/lib/language_server/protocol/constants.rb +11 -0
- data/lib/language_server/protocol/interfaces/apply_workspace_edit_params.rb +29 -0
- data/lib/language_server/protocol/interfaces/apply_workspace_edit_response.rb +29 -0
- data/lib/language_server/protocol/interfaces/cancel_params.rb +29 -0
- data/lib/language_server/protocol/interfaces/client_capabilities.rb +47 -0
- data/lib/language_server/protocol/interfaces/code_action_context.rb +33 -0
- data/lib/language_server/protocol/interfaces/code_action_params.rb +50 -0
- data/lib/language_server/protocol/interfaces/code_lens.rb +55 -0
- data/lib/language_server/protocol/interfaces/code_lens_options.rb +32 -0
- data/lib/language_server/protocol/interfaces/code_lens_params.rb +29 -0
- data/lib/language_server/protocol/interfaces/code_lens_registration_options.rb +29 -0
- data/lib/language_server/protocol/interfaces/command.rb +48 -0
- data/lib/language_server/protocol/interfaces/completion_item.rb +145 -0
- data/lib/language_server/protocol/interfaces/completion_list.rb +43 -0
- data/lib/language_server/protocol/interfaces/completion_options.rb +42 -0
- data/lib/language_server/protocol/interfaces/completion_registration_options.rb +39 -0
- data/lib/language_server/protocol/interfaces/diagnostic.rb +67 -0
- data/lib/language_server/protocol/interfaces/did_change_configuration_params.rb +29 -0
- data/lib/language_server/protocol/interfaces/did_change_text_document_params.rb +40 -0
- data/lib/language_server/protocol/interfaces/did_change_watched_files_params.rb +29 -0
- data/lib/language_server/protocol/interfaces/did_close_text_document_params.rb +29 -0
- data/lib/language_server/protocol/interfaces/did_open_text_document_params.rb +29 -0
- data/lib/language_server/protocol/interfaces/did_save_text_document_params.rb +39 -0
- data/lib/language_server/protocol/interfaces/document_filter.rb +47 -0
- data/lib/language_server/protocol/interfaces/document_formatting_params.rb +38 -0
- data/lib/language_server/protocol/interfaces/document_highlight.rb +43 -0
- data/lib/language_server/protocol/interfaces/document_link.rb +42 -0
- data/lib/language_server/protocol/interfaces/document_link_options.rb +32 -0
- data/lib/language_server/protocol/interfaces/document_link_params.rb +29 -0
- data/lib/language_server/protocol/interfaces/document_link_registration_options.rb +29 -0
- data/lib/language_server/protocol/interfaces/document_on_type_formatting_options.rb +41 -0
- data/lib/language_server/protocol/interfaces/document_on_type_formatting_params.rb +56 -0
- data/lib/language_server/protocol/interfaces/document_on_type_formatting_registration_options.rb +38 -0
- data/lib/language_server/protocol/interfaces/document_range_formatting_params.rb +47 -0
- data/lib/language_server/protocol/interfaces/document_symbol_params.rb +29 -0
- data/lib/language_server/protocol/interfaces/execute_command_options.rb +32 -0
- data/lib/language_server/protocol/interfaces/execute_command_params.rb +38 -0
- data/lib/language_server/protocol/interfaces/execute_command_registration_options.rb +32 -0
- data/lib/language_server/protocol/interfaces/file_event.rb +41 -0
- data/lib/language_server/protocol/interfaces/formatting_options.rb +41 -0
- data/lib/language_server/protocol/interfaces/hover.rb +42 -0
- data/lib/language_server/protocol/interfaces/initialize_error.rb +35 -0
- data/lib/language_server/protocol/interfaces/initialize_params.rb +79 -0
- data/lib/language_server/protocol/interfaces/initialize_result.rb +29 -0
- data/lib/language_server/protocol/interfaces/location.rb +32 -0
- data/lib/language_server/protocol/interfaces/log_message_params.rb +38 -0
- data/lib/language_server/protocol/interfaces/message.rb +26 -0
- data/lib/language_server/protocol/interfaces/message_action_item.rb +29 -0
- data/lib/language_server/protocol/interfaces/notification_message.rb +38 -0
- data/lib/language_server/protocol/interfaces/parameter_information.rb +44 -0
- data/lib/language_server/protocol/interfaces/position.rb +38 -0
- data/lib/language_server/protocol/interfaces/publish_diagnostics_params.rb +38 -0
- data/lib/language_server/protocol/interfaces/range.rb +38 -0
- data/lib/language_server/protocol/interfaces/reference_context.rb +29 -0
- data/lib/language_server/protocol/interfaces/reference_params.rb +26 -0
- data/lib/language_server/protocol/interfaces/registration.rb +51 -0
- data/lib/language_server/protocol/interfaces/registration_params.rb +26 -0
- data/lib/language_server/protocol/interfaces/rename_params.rb +49 -0
- data/lib/language_server/protocol/interfaces/request_message.rb +47 -0
- data/lib/language_server/protocol/interfaces/response_error.rb +48 -0
- data/lib/language_server/protocol/interfaces/response_message.rb +48 -0
- data/lib/language_server/protocol/interfaces/save_options.rb +32 -0
- data/lib/language_server/protocol/interfaces/server_capabilities.rb +183 -0
- data/lib/language_server/protocol/interfaces/show_message_params.rb +38 -0
- data/lib/language_server/protocol/interfaces/show_message_request_params.rb +47 -0
- data/lib/language_server/protocol/interfaces/signature_help.rb +64 -0
- data/lib/language_server/protocol/interfaces/signature_help_options.rb +33 -0
- data/lib/language_server/protocol/interfaces/signature_help_registration_options.rb +30 -0
- data/lib/language_server/protocol/interfaces/signature_information.rb +54 -0
- data/lib/language_server/protocol/interfaces/symbol_information.rb +60 -0
- data/lib/language_server/protocol/interfaces/text_document_change_registration_options.rb +33 -0
- data/lib/language_server/protocol/interfaces/text_document_client_capabilities.rb +155 -0
- data/lib/language_server/protocol/interfaces/text_document_content_change_event.rb +51 -0
- data/lib/language_server/protocol/interfaces/text_document_edit.rb +38 -0
- data/lib/language_server/protocol/interfaces/text_document_identifier.rb +29 -0
- data/lib/language_server/protocol/interfaces/text_document_item.rb +57 -0
- data/lib/language_server/protocol/interfaces/text_document_position_params.rb +38 -0
- data/lib/language_server/protocol/interfaces/text_document_registration_options.rb +30 -0
- data/lib/language_server/protocol/interfaces/text_document_save_registration_options.rb +29 -0
- data/lib/language_server/protocol/interfaces/text_document_sync_options.rb +66 -0
- data/lib/language_server/protocol/interfaces/text_edit.rb +40 -0
- data/lib/language_server/protocol/interfaces/unregistration.rb +42 -0
- data/lib/language_server/protocol/interfaces/unregistration_params.rb +26 -0
- data/lib/language_server/protocol/interfaces/versioned_text_document_identifier.rb +29 -0
- data/lib/language_server/protocol/interfaces/will_save_text_document_params.rb +41 -0
- data/lib/language_server/protocol/interfaces/workspace_client_capabilites.rb +78 -0
- data/lib/language_server/protocol/interfaces/workspace_edit.rb +40 -0
- data/lib/language_server/protocol/interfaces/workspace_symbol_params.rb +32 -0
- data/lib/language_server/protocol/interfaces.rb +87 -0
- data/lib/language_server/version.rb +3 -0
- data/lib/language_server.rb +176 -0
- data/package.json +10 -0
- data/scripts/generateFiles.ts +224 -0
- data/yarn.lock +295 -0
- metadata +220 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
class ReferenceParams
|
|
5
|
+
def initialize(context:)
|
|
6
|
+
@attributes = {}
|
|
7
|
+
|
|
8
|
+
@attributes[:context] = context
|
|
9
|
+
|
|
10
|
+
@attributes.freeze
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# @return [ReferenceContext]
|
|
14
|
+
def context
|
|
15
|
+
attributes.fetch(:context)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
attr_reader :attributes
|
|
19
|
+
|
|
20
|
+
def to_json(*args)
|
|
21
|
+
attributes.to_json(*args)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
#
|
|
5
|
+
# General paramters to to regsiter for a capability.
|
|
6
|
+
#
|
|
7
|
+
class Registration
|
|
8
|
+
def initialize(id:, method:, register_options: nil)
|
|
9
|
+
@attributes = {}
|
|
10
|
+
|
|
11
|
+
@attributes[:id] = id
|
|
12
|
+
@attributes[:method] = method
|
|
13
|
+
@attributes[:registerOptions] = register_options if register_options
|
|
14
|
+
|
|
15
|
+
@attributes.freeze
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
#
|
|
19
|
+
# The id used to register the request. The id can be used to deregister
|
|
20
|
+
# the request again.
|
|
21
|
+
#
|
|
22
|
+
# @return [string]
|
|
23
|
+
def id
|
|
24
|
+
attributes.fetch(:id)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
#
|
|
28
|
+
# The method / capability to register for.
|
|
29
|
+
#
|
|
30
|
+
# @return [string]
|
|
31
|
+
def method
|
|
32
|
+
attributes.fetch(:method)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
#
|
|
36
|
+
# Options necessary for the registration.
|
|
37
|
+
#
|
|
38
|
+
# @return [any]
|
|
39
|
+
def register_options
|
|
40
|
+
attributes.fetch(:registerOptions)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
attr_reader :attributes
|
|
44
|
+
|
|
45
|
+
def to_json(*args)
|
|
46
|
+
attributes.to_json(*args)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
class RegistrationParams
|
|
5
|
+
def initialize(registrations:)
|
|
6
|
+
@attributes = {}
|
|
7
|
+
|
|
8
|
+
@attributes[:registrations] = registrations
|
|
9
|
+
|
|
10
|
+
@attributes.freeze
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# @return [Registration[]]
|
|
14
|
+
def registrations
|
|
15
|
+
attributes.fetch(:registrations)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
attr_reader :attributes
|
|
19
|
+
|
|
20
|
+
def to_json(*args)
|
|
21
|
+
attributes.to_json(*args)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
class RenameParams
|
|
5
|
+
def initialize(text_document:, position:, new_name:)
|
|
6
|
+
@attributes = {}
|
|
7
|
+
|
|
8
|
+
@attributes[:textDocument] = text_document
|
|
9
|
+
@attributes[:position] = position
|
|
10
|
+
@attributes[:newName] = new_name
|
|
11
|
+
|
|
12
|
+
@attributes.freeze
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
#
|
|
16
|
+
# The document to format.
|
|
17
|
+
#
|
|
18
|
+
# @return [TextDocumentIdentifier]
|
|
19
|
+
def text_document
|
|
20
|
+
attributes.fetch(:textDocument)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
#
|
|
24
|
+
# The position at which this request was sent.
|
|
25
|
+
#
|
|
26
|
+
# @return [Position]
|
|
27
|
+
def position
|
|
28
|
+
attributes.fetch(:position)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
#
|
|
32
|
+
# The new name of the symbol. If the given name is not valid the
|
|
33
|
+
# request must return a [ResponseError](#ResponseError) with an
|
|
34
|
+
# appropriate message set.
|
|
35
|
+
#
|
|
36
|
+
# @return [string]
|
|
37
|
+
def new_name
|
|
38
|
+
attributes.fetch(:newName)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
attr_reader :attributes
|
|
42
|
+
|
|
43
|
+
def to_json(*args)
|
|
44
|
+
attributes.to_json(*args)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
class RequestMessage
|
|
5
|
+
def initialize(id:, method:, params: nil)
|
|
6
|
+
@attributes = {}
|
|
7
|
+
|
|
8
|
+
@attributes[:id] = id
|
|
9
|
+
@attributes[:method] = method
|
|
10
|
+
@attributes[:params] = params if params
|
|
11
|
+
|
|
12
|
+
@attributes.freeze
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
#
|
|
16
|
+
# The request id.
|
|
17
|
+
#
|
|
18
|
+
# @return [string | number]
|
|
19
|
+
def id
|
|
20
|
+
attributes.fetch(:id)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
#
|
|
24
|
+
# The method to be invoked.
|
|
25
|
+
#
|
|
26
|
+
# @return [string]
|
|
27
|
+
def method
|
|
28
|
+
attributes.fetch(:method)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
#
|
|
32
|
+
# The method's params.
|
|
33
|
+
#
|
|
34
|
+
# @return [any]
|
|
35
|
+
def params
|
|
36
|
+
attributes.fetch(:params)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
attr_reader :attributes
|
|
40
|
+
|
|
41
|
+
def to_json(*args)
|
|
42
|
+
attributes.to_json(*args)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
class ResponseError
|
|
5
|
+
def initialize(code:, message:, data: nil)
|
|
6
|
+
@attributes = {}
|
|
7
|
+
|
|
8
|
+
@attributes[:code] = code
|
|
9
|
+
@attributes[:message] = message
|
|
10
|
+
@attributes[:data] = data if data
|
|
11
|
+
|
|
12
|
+
@attributes.freeze
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
#
|
|
16
|
+
# A number indicating the error type that occurred.
|
|
17
|
+
#
|
|
18
|
+
# @return [number]
|
|
19
|
+
def code
|
|
20
|
+
attributes.fetch(:code)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
#
|
|
24
|
+
# A string providing a short description of the error.
|
|
25
|
+
#
|
|
26
|
+
# @return [string]
|
|
27
|
+
def message
|
|
28
|
+
attributes.fetch(:message)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
#
|
|
32
|
+
# A Primitive or Structured value that contains additional
|
|
33
|
+
# information about the error. Can be omitted.
|
|
34
|
+
#
|
|
35
|
+
# @return [D]
|
|
36
|
+
def data
|
|
37
|
+
attributes.fetch(:data)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
attr_reader :attributes
|
|
41
|
+
|
|
42
|
+
def to_json(*args)
|
|
43
|
+
attributes.to_json(*args)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
class ResponseMessage
|
|
5
|
+
def initialize(id:, result: nil, error: nil)
|
|
6
|
+
@attributes = {}
|
|
7
|
+
|
|
8
|
+
@attributes[:id] = id
|
|
9
|
+
@attributes[:result] = result if result
|
|
10
|
+
@attributes[:error] = error if error
|
|
11
|
+
|
|
12
|
+
@attributes.freeze
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
#
|
|
16
|
+
# The request id.
|
|
17
|
+
#
|
|
18
|
+
# @return [string | number]
|
|
19
|
+
def id
|
|
20
|
+
attributes.fetch(:id)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
#
|
|
24
|
+
# The result of a request. This can be omitted in
|
|
25
|
+
# the case of an error.
|
|
26
|
+
#
|
|
27
|
+
# @return [any]
|
|
28
|
+
def result
|
|
29
|
+
attributes.fetch(:result)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
#
|
|
33
|
+
# The error object in case a request fails.
|
|
34
|
+
#
|
|
35
|
+
# @return [ResponseError<any>]
|
|
36
|
+
def error
|
|
37
|
+
attributes.fetch(:error)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
attr_reader :attributes
|
|
41
|
+
|
|
42
|
+
def to_json(*args)
|
|
43
|
+
attributes.to_json(*args)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
#
|
|
5
|
+
# Save options.
|
|
6
|
+
#
|
|
7
|
+
class SaveOptions
|
|
8
|
+
def initialize(include_text: nil)
|
|
9
|
+
@attributes = {}
|
|
10
|
+
|
|
11
|
+
@attributes[:includeText] = include_text if include_text
|
|
12
|
+
|
|
13
|
+
@attributes.freeze
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# The client is supposed to include the content on save.
|
|
18
|
+
#
|
|
19
|
+
# @return [boolean]
|
|
20
|
+
def include_text
|
|
21
|
+
attributes.fetch(:includeText)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
attr_reader :attributes
|
|
25
|
+
|
|
26
|
+
def to_json(*args)
|
|
27
|
+
attributes.to_json(*args)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
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)
|
|
6
|
+
@attributes = {}
|
|
7
|
+
|
|
8
|
+
@attributes[:textDocumentSync] = text_document_sync if text_document_sync
|
|
9
|
+
@attributes[:hoverProvider] = hover_provider if hover_provider
|
|
10
|
+
@attributes[:completionProvider] = completion_provider if completion_provider
|
|
11
|
+
@attributes[:signatureHelpProvider] = signature_help_provider if signature_help_provider
|
|
12
|
+
@attributes[:definitionProvider] = definition_provider if definition_provider
|
|
13
|
+
@attributes[:referencesProvider] = references_provider if references_provider
|
|
14
|
+
@attributes[:documentHighlightProvider] = document_highlight_provider if document_highlight_provider
|
|
15
|
+
@attributes[:documentSymbolProvider] = document_symbol_provider if document_symbol_provider
|
|
16
|
+
@attributes[:workspaceSymbolProvider] = workspace_symbol_provider if workspace_symbol_provider
|
|
17
|
+
@attributes[:codeActionProvider] = code_action_provider if code_action_provider
|
|
18
|
+
@attributes[:codeLensProvider] = code_lens_provider if code_lens_provider
|
|
19
|
+
@attributes[:documentFormattingProvider] = document_formatting_provider if document_formatting_provider
|
|
20
|
+
@attributes[:documentRangeFormattingProvider] = document_range_formatting_provider if document_range_formatting_provider
|
|
21
|
+
@attributes[:documentOnTypeFormattingProvider] = document_on_type_formatting_provider if document_on_type_formatting_provider
|
|
22
|
+
@attributes[:renameProvider] = rename_provider if rename_provider
|
|
23
|
+
@attributes[:documentLinkProvider] = document_link_provider if document_link_provider
|
|
24
|
+
@attributes[:executeCommandProvider] = execute_command_provider if execute_command_provider
|
|
25
|
+
@attributes[:experimental] = experimental if experimental
|
|
26
|
+
|
|
27
|
+
@attributes.freeze
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
#
|
|
31
|
+
# Defines how text documents are synced. Is either a detailed structure defining each notification or
|
|
32
|
+
# for backwards compatibility the TextDocumentSyncKind number.
|
|
33
|
+
#
|
|
34
|
+
# @return [number | TextDocumentSyncOptions]
|
|
35
|
+
def text_document_sync
|
|
36
|
+
attributes.fetch(:textDocumentSync)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
#
|
|
40
|
+
# The server provides hover support.
|
|
41
|
+
#
|
|
42
|
+
# @return [boolean]
|
|
43
|
+
def hover_provider
|
|
44
|
+
attributes.fetch(:hoverProvider)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
#
|
|
48
|
+
# The server provides completion support.
|
|
49
|
+
#
|
|
50
|
+
# @return [CompletionOptions]
|
|
51
|
+
def completion_provider
|
|
52
|
+
attributes.fetch(:completionProvider)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
#
|
|
56
|
+
# The server provides signature help support.
|
|
57
|
+
#
|
|
58
|
+
# @return [SignatureHelpOptions]
|
|
59
|
+
def signature_help_provider
|
|
60
|
+
attributes.fetch(:signatureHelpProvider)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
#
|
|
64
|
+
# The server provides goto definition support.
|
|
65
|
+
#
|
|
66
|
+
# @return [boolean]
|
|
67
|
+
def definition_provider
|
|
68
|
+
attributes.fetch(:definitionProvider)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
#
|
|
72
|
+
# The server provides find references support.
|
|
73
|
+
#
|
|
74
|
+
# @return [boolean]
|
|
75
|
+
def references_provider
|
|
76
|
+
attributes.fetch(:referencesProvider)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
#
|
|
80
|
+
# The server provides document highlight support.
|
|
81
|
+
#
|
|
82
|
+
# @return [boolean]
|
|
83
|
+
def document_highlight_provider
|
|
84
|
+
attributes.fetch(:documentHighlightProvider)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
#
|
|
88
|
+
# The server provides document symbol support.
|
|
89
|
+
#
|
|
90
|
+
# @return [boolean]
|
|
91
|
+
def document_symbol_provider
|
|
92
|
+
attributes.fetch(:documentSymbolProvider)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
#
|
|
96
|
+
# The server provides workspace symbol support.
|
|
97
|
+
#
|
|
98
|
+
# @return [boolean]
|
|
99
|
+
def workspace_symbol_provider
|
|
100
|
+
attributes.fetch(:workspaceSymbolProvider)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
#
|
|
104
|
+
# The server provides code actions.
|
|
105
|
+
#
|
|
106
|
+
# @return [boolean]
|
|
107
|
+
def code_action_provider
|
|
108
|
+
attributes.fetch(:codeActionProvider)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
#
|
|
112
|
+
# The server provides code lens.
|
|
113
|
+
#
|
|
114
|
+
# @return [CodeLensOptions]
|
|
115
|
+
def code_lens_provider
|
|
116
|
+
attributes.fetch(:codeLensProvider)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
#
|
|
120
|
+
# The server provides document formatting.
|
|
121
|
+
#
|
|
122
|
+
# @return [boolean]
|
|
123
|
+
def document_formatting_provider
|
|
124
|
+
attributes.fetch(:documentFormattingProvider)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
#
|
|
128
|
+
# The server provides document range formatting.
|
|
129
|
+
#
|
|
130
|
+
# @return [boolean]
|
|
131
|
+
def document_range_formatting_provider
|
|
132
|
+
attributes.fetch(:documentRangeFormattingProvider)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
#
|
|
136
|
+
# The server provides document formatting on typing.
|
|
137
|
+
#
|
|
138
|
+
# @return [DocumentOnTypeFormattingOptions]
|
|
139
|
+
def document_on_type_formatting_provider
|
|
140
|
+
attributes.fetch(:documentOnTypeFormattingProvider)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
#
|
|
144
|
+
# The server provides rename support.
|
|
145
|
+
#
|
|
146
|
+
# @return [boolean]
|
|
147
|
+
def rename_provider
|
|
148
|
+
attributes.fetch(:renameProvider)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
#
|
|
152
|
+
# The server provides document link support.
|
|
153
|
+
#
|
|
154
|
+
# @return [DocumentLinkOptions]
|
|
155
|
+
def document_link_provider
|
|
156
|
+
attributes.fetch(:documentLinkProvider)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
#
|
|
160
|
+
# The server provides execute command support.
|
|
161
|
+
#
|
|
162
|
+
# @return [ExecuteCommandOptions]
|
|
163
|
+
def execute_command_provider
|
|
164
|
+
attributes.fetch(:executeCommandProvider)
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
#
|
|
168
|
+
# Experimental server capabilities.
|
|
169
|
+
#
|
|
170
|
+
# @return [any]
|
|
171
|
+
def experimental
|
|
172
|
+
attributes.fetch(:experimental)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
attr_reader :attributes
|
|
176
|
+
|
|
177
|
+
def to_json(*args)
|
|
178
|
+
attributes.to_json(*args)
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
class ShowMessageParams
|
|
5
|
+
def initialize(type:, message:)
|
|
6
|
+
@attributes = {}
|
|
7
|
+
|
|
8
|
+
@attributes[:type] = type
|
|
9
|
+
@attributes[:message] = message
|
|
10
|
+
|
|
11
|
+
@attributes.freeze
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
#
|
|
15
|
+
# The message type. See {@link MessageType}.
|
|
16
|
+
#
|
|
17
|
+
# @return [number]
|
|
18
|
+
def type
|
|
19
|
+
attributes.fetch(:type)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
#
|
|
23
|
+
# The actual message.
|
|
24
|
+
#
|
|
25
|
+
# @return [string]
|
|
26
|
+
def message
|
|
27
|
+
attributes.fetch(:message)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
attr_reader :attributes
|
|
31
|
+
|
|
32
|
+
def to_json(*args)
|
|
33
|
+
attributes.to_json(*args)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
class ShowMessageRequestParams
|
|
5
|
+
def initialize(type:, message:, actions: nil)
|
|
6
|
+
@attributes = {}
|
|
7
|
+
|
|
8
|
+
@attributes[:type] = type
|
|
9
|
+
@attributes[:message] = message
|
|
10
|
+
@attributes[:actions] = actions if actions
|
|
11
|
+
|
|
12
|
+
@attributes.freeze
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
#
|
|
16
|
+
# The message type. See {@link MessageType}
|
|
17
|
+
#
|
|
18
|
+
# @return [number]
|
|
19
|
+
def type
|
|
20
|
+
attributes.fetch(:type)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
#
|
|
24
|
+
# The actual message
|
|
25
|
+
#
|
|
26
|
+
# @return [string]
|
|
27
|
+
def message
|
|
28
|
+
attributes.fetch(:message)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
#
|
|
32
|
+
# The message action items to present.
|
|
33
|
+
#
|
|
34
|
+
# @return [MessageActionItem[]]
|
|
35
|
+
def actions
|
|
36
|
+
attributes.fetch(:actions)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
attr_reader :attributes
|
|
40
|
+
|
|
41
|
+
def to_json(*args)
|
|
42
|
+
attributes.to_json(*args)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
#
|
|
5
|
+
# Signature help represents the signature of something
|
|
6
|
+
# callable. There can be multiple signature but only one
|
|
7
|
+
# active and only one active parameter.
|
|
8
|
+
#
|
|
9
|
+
class SignatureHelp
|
|
10
|
+
def initialize(signatures:, active_signature: nil, active_parameter: nil)
|
|
11
|
+
@attributes = {}
|
|
12
|
+
|
|
13
|
+
@attributes[:signatures] = signatures
|
|
14
|
+
@attributes[:activeSignature] = active_signature if active_signature
|
|
15
|
+
@attributes[:activeParameter] = active_parameter if active_parameter
|
|
16
|
+
|
|
17
|
+
@attributes.freeze
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
#
|
|
21
|
+
# One or more signatures.
|
|
22
|
+
#
|
|
23
|
+
# @return [SignatureInformation[]]
|
|
24
|
+
def signatures
|
|
25
|
+
attributes.fetch(:signatures)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
#
|
|
29
|
+
# The active signature. If omitted or the value lies outside the
|
|
30
|
+
# range of `signatures` the value defaults to zero or is ignored if
|
|
31
|
+
# `signatures.length === 0`. Whenever possible implementors should
|
|
32
|
+
# make an active decision about the active signature and shouldn't
|
|
33
|
+
# rely on a default value.
|
|
34
|
+
# In future version of the protocol this property might become
|
|
35
|
+
# mandantory to better express this.
|
|
36
|
+
#
|
|
37
|
+
# @return [number]
|
|
38
|
+
def active_signature
|
|
39
|
+
attributes.fetch(:activeSignature)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
#
|
|
43
|
+
# The active parameter of the active signature. If omitted or the value
|
|
44
|
+
# lies outside the range of `signatures[activeSignature].parameters`
|
|
45
|
+
# defaults to 0 if the active signature has parameters. If
|
|
46
|
+
# the active signature has no parameters it is ignored.
|
|
47
|
+
# In future version of the protocol this property might become
|
|
48
|
+
# mandantory to better express the active parameter if the
|
|
49
|
+
# active signature does have any.
|
|
50
|
+
#
|
|
51
|
+
# @return [number]
|
|
52
|
+
def active_parameter
|
|
53
|
+
attributes.fetch(:activeParameter)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
attr_reader :attributes
|
|
57
|
+
|
|
58
|
+
def to_json(*args)
|
|
59
|
+
attributes.to_json(*args)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module LanguageServer
|
|
2
|
+
module Protocol
|
|
3
|
+
module Interfaces
|
|
4
|
+
#
|
|
5
|
+
# Signature help options.
|
|
6
|
+
#
|
|
7
|
+
class SignatureHelpOptions
|
|
8
|
+
def initialize(trigger_characters: nil)
|
|
9
|
+
@attributes = {}
|
|
10
|
+
|
|
11
|
+
@attributes[:triggerCharacters] = trigger_characters if trigger_characters
|
|
12
|
+
|
|
13
|
+
@attributes.freeze
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
#
|
|
17
|
+
# The characters that trigger signature help
|
|
18
|
+
# automatically.
|
|
19
|
+
#
|
|
20
|
+
# @return [string[]]
|
|
21
|
+
def trigger_characters
|
|
22
|
+
attributes.fetch(:triggerCharacters)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
attr_reader :attributes
|
|
26
|
+
|
|
27
|
+
def to_json(*args)
|
|
28
|
+
attributes.to_json(*args)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|