language_server 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +6 -0
- data/circle.yml +0 -1
- data/docker-compose.yml +2 -7
- data/language_server.gemspec +1 -0
- data/lib/language_server/completion_provider/ad_hoc.rb +6 -6
- data/lib/language_server/completion_provider/rcodetools.rb +3 -5
- data/lib/language_server/definition_provider/ad_hoc.rb +34 -0
- data/lib/language_server/logger.rb +37 -0
- data/lib/language_server/project/node.rb +65 -1
- data/lib/language_server/project/parser.rb +40 -10
- data/lib/language_server/project.rb +20 -3
- data/lib/language_server/version.rb +1 -1
- data/lib/language_server.rb +43 -24
- metadata +19 -110
- data/Dockerfile-node.development +0 -6
- data/bin/generate_files +0 -5
- data/lib/language_server/protocol/constants/completion_item_kind.rb +0 -29
- data/lib/language_server/protocol/constants/diagnostic_severity.rb +0 -24
- data/lib/language_server/protocol/constants/document_highlight_kind.rb +0 -23
- data/lib/language_server/protocol/constants/error_codes.rb +0 -18
- data/lib/language_server/protocol/constants/file_change_type.rb +0 -23
- data/lib/language_server/protocol/constants/initialize_error.rb +0 -15
- data/lib/language_server/protocol/constants/insert_text_format.rb +0 -27
- data/lib/language_server/protocol/constants/message_type.rb +0 -24
- data/lib/language_server/protocol/constants/symbol_kind.rb +0 -29
- data/lib/language_server/protocol/constants/text_document_save_reason.rb +0 -24
- data/lib/language_server/protocol/constants/text_document_sync_kind.rb +0 -26
- data/lib/language_server/protocol/constants.rb +0 -11
- data/lib/language_server/protocol/interfaces/apply_workspace_edit_params.rb +0 -29
- data/lib/language_server/protocol/interfaces/apply_workspace_edit_response.rb +0 -29
- data/lib/language_server/protocol/interfaces/cancel_params.rb +0 -29
- data/lib/language_server/protocol/interfaces/client_capabilities.rb +0 -47
- data/lib/language_server/protocol/interfaces/code_action_context.rb +0 -33
- data/lib/language_server/protocol/interfaces/code_action_params.rb +0 -50
- data/lib/language_server/protocol/interfaces/code_lens.rb +0 -55
- data/lib/language_server/protocol/interfaces/code_lens_options.rb +0 -32
- data/lib/language_server/protocol/interfaces/code_lens_params.rb +0 -29
- data/lib/language_server/protocol/interfaces/code_lens_registration_options.rb +0 -29
- data/lib/language_server/protocol/interfaces/command.rb +0 -48
- data/lib/language_server/protocol/interfaces/completion_item.rb +0 -145
- data/lib/language_server/protocol/interfaces/completion_list.rb +0 -43
- data/lib/language_server/protocol/interfaces/completion_options.rb +0 -42
- data/lib/language_server/protocol/interfaces/completion_registration_options.rb +0 -39
- data/lib/language_server/protocol/interfaces/diagnostic.rb +0 -67
- data/lib/language_server/protocol/interfaces/did_change_configuration_params.rb +0 -29
- data/lib/language_server/protocol/interfaces/did_change_text_document_params.rb +0 -40
- data/lib/language_server/protocol/interfaces/did_change_watched_files_params.rb +0 -29
- data/lib/language_server/protocol/interfaces/did_close_text_document_params.rb +0 -29
- data/lib/language_server/protocol/interfaces/did_open_text_document_params.rb +0 -29
- data/lib/language_server/protocol/interfaces/did_save_text_document_params.rb +0 -39
- data/lib/language_server/protocol/interfaces/document_filter.rb +0 -47
- data/lib/language_server/protocol/interfaces/document_formatting_params.rb +0 -38
- data/lib/language_server/protocol/interfaces/document_highlight.rb +0 -43
- data/lib/language_server/protocol/interfaces/document_link.rb +0 -42
- data/lib/language_server/protocol/interfaces/document_link_options.rb +0 -32
- data/lib/language_server/protocol/interfaces/document_link_params.rb +0 -29
- data/lib/language_server/protocol/interfaces/document_link_registration_options.rb +0 -29
- data/lib/language_server/protocol/interfaces/document_on_type_formatting_options.rb +0 -41
- data/lib/language_server/protocol/interfaces/document_on_type_formatting_params.rb +0 -56
- data/lib/language_server/protocol/interfaces/document_on_type_formatting_registration_options.rb +0 -38
- data/lib/language_server/protocol/interfaces/document_range_formatting_params.rb +0 -47
- data/lib/language_server/protocol/interfaces/document_symbol_params.rb +0 -29
- data/lib/language_server/protocol/interfaces/execute_command_options.rb +0 -32
- data/lib/language_server/protocol/interfaces/execute_command_params.rb +0 -38
- data/lib/language_server/protocol/interfaces/execute_command_registration_options.rb +0 -32
- data/lib/language_server/protocol/interfaces/file_event.rb +0 -41
- data/lib/language_server/protocol/interfaces/formatting_options.rb +0 -41
- data/lib/language_server/protocol/interfaces/hover.rb +0 -42
- data/lib/language_server/protocol/interfaces/initialize_error.rb +0 -35
- data/lib/language_server/protocol/interfaces/initialize_params.rb +0 -79
- data/lib/language_server/protocol/interfaces/initialize_result.rb +0 -29
- data/lib/language_server/protocol/interfaces/location.rb +0 -32
- data/lib/language_server/protocol/interfaces/log_message_params.rb +0 -38
- data/lib/language_server/protocol/interfaces/message.rb +0 -26
- data/lib/language_server/protocol/interfaces/message_action_item.rb +0 -29
- data/lib/language_server/protocol/interfaces/notification_message.rb +0 -38
- data/lib/language_server/protocol/interfaces/parameter_information.rb +0 -44
- data/lib/language_server/protocol/interfaces/position.rb +0 -38
- data/lib/language_server/protocol/interfaces/publish_diagnostics_params.rb +0 -38
- data/lib/language_server/protocol/interfaces/range.rb +0 -38
- data/lib/language_server/protocol/interfaces/reference_context.rb +0 -29
- data/lib/language_server/protocol/interfaces/reference_params.rb +0 -26
- data/lib/language_server/protocol/interfaces/registration.rb +0 -51
- data/lib/language_server/protocol/interfaces/registration_params.rb +0 -26
- data/lib/language_server/protocol/interfaces/rename_params.rb +0 -49
- data/lib/language_server/protocol/interfaces/request_message.rb +0 -47
- data/lib/language_server/protocol/interfaces/response_error.rb +0 -48
- data/lib/language_server/protocol/interfaces/response_message.rb +0 -48
- data/lib/language_server/protocol/interfaces/save_options.rb +0 -32
- data/lib/language_server/protocol/interfaces/server_capabilities.rb +0 -183
- data/lib/language_server/protocol/interfaces/show_message_params.rb +0 -38
- data/lib/language_server/protocol/interfaces/show_message_request_params.rb +0 -47
- data/lib/language_server/protocol/interfaces/signature_help.rb +0 -64
- data/lib/language_server/protocol/interfaces/signature_help_options.rb +0 -33
- data/lib/language_server/protocol/interfaces/signature_help_registration_options.rb +0 -30
- data/lib/language_server/protocol/interfaces/signature_information.rb +0 -54
- data/lib/language_server/protocol/interfaces/symbol_information.rb +0 -60
- data/lib/language_server/protocol/interfaces/text_document_change_registration_options.rb +0 -33
- data/lib/language_server/protocol/interfaces/text_document_client_capabilities.rb +0 -155
- data/lib/language_server/protocol/interfaces/text_document_content_change_event.rb +0 -51
- data/lib/language_server/protocol/interfaces/text_document_edit.rb +0 -38
- data/lib/language_server/protocol/interfaces/text_document_identifier.rb +0 -29
- data/lib/language_server/protocol/interfaces/text_document_item.rb +0 -57
- data/lib/language_server/protocol/interfaces/text_document_position_params.rb +0 -38
- data/lib/language_server/protocol/interfaces/text_document_registration_options.rb +0 -30
- data/lib/language_server/protocol/interfaces/text_document_save_registration_options.rb +0 -29
- data/lib/language_server/protocol/interfaces/text_document_sync_options.rb +0 -66
- data/lib/language_server/protocol/interfaces/text_edit.rb +0 -40
- data/lib/language_server/protocol/interfaces/unregistration.rb +0 -42
- data/lib/language_server/protocol/interfaces/unregistration_params.rb +0 -26
- data/lib/language_server/protocol/interfaces/versioned_text_document_identifier.rb +0 -29
- data/lib/language_server/protocol/interfaces/will_save_text_document_params.rb +0 -41
- data/lib/language_server/protocol/interfaces/workspace_client_capabilites.rb +0 -78
- data/lib/language_server/protocol/interfaces/workspace_edit.rb +0 -40
- data/lib/language_server/protocol/interfaces/workspace_symbol_params.rb +0 -32
- data/lib/language_server/protocol/interfaces.rb +0 -87
- data/lib/language_server/protocol/stdio/reader.rb +0 -37
- data/lib/language_server/protocol/stdio/writer.rb +0 -38
- data/lib/language_server/protocol/stdio.rb +0 -2
- data/scripts/generateFiles.ts +0 -224
- data/yarn.lock +0 -295
@@ -1,41 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
#
|
5
|
-
# An event describing a file change.
|
6
|
-
#
|
7
|
-
class FileEvent
|
8
|
-
def initialize(uri:, type:)
|
9
|
-
@attributes = {}
|
10
|
-
|
11
|
-
@attributes[:uri] = uri
|
12
|
-
@attributes[:type] = type
|
13
|
-
|
14
|
-
@attributes.freeze
|
15
|
-
end
|
16
|
-
|
17
|
-
#
|
18
|
-
# The file's URI.
|
19
|
-
#
|
20
|
-
# @return [string]
|
21
|
-
def uri
|
22
|
-
attributes.fetch(:uri)
|
23
|
-
end
|
24
|
-
|
25
|
-
#
|
26
|
-
# The change type.
|
27
|
-
#
|
28
|
-
# @return [number]
|
29
|
-
def type
|
30
|
-
attributes.fetch(:type)
|
31
|
-
end
|
32
|
-
|
33
|
-
attr_reader :attributes
|
34
|
-
|
35
|
-
def to_json(*args)
|
36
|
-
attributes.to_json(*args)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
#
|
5
|
-
# Value-object describing what options formatting should use.
|
6
|
-
#
|
7
|
-
class FormattingOptions
|
8
|
-
def initialize(tab_size:, insert_spaces:)
|
9
|
-
@attributes = {}
|
10
|
-
|
11
|
-
@attributes[:tabSize] = tab_size
|
12
|
-
@attributes[:insertSpaces] = insert_spaces
|
13
|
-
|
14
|
-
@attributes.freeze
|
15
|
-
end
|
16
|
-
|
17
|
-
#
|
18
|
-
# Size of a tab in spaces.
|
19
|
-
#
|
20
|
-
# @return [number]
|
21
|
-
def tab_size
|
22
|
-
attributes.fetch(:tabSize)
|
23
|
-
end
|
24
|
-
|
25
|
-
#
|
26
|
-
# Prefer spaces over tabs.
|
27
|
-
#
|
28
|
-
# @return [boolean]
|
29
|
-
def insert_spaces
|
30
|
-
attributes.fetch(:insertSpaces)
|
31
|
-
end
|
32
|
-
|
33
|
-
attr_reader :attributes
|
34
|
-
|
35
|
-
def to_json(*args)
|
36
|
-
attributes.to_json(*args)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
#
|
5
|
-
# The result of a hover request.
|
6
|
-
#
|
7
|
-
class Hover
|
8
|
-
def initialize(contents:, range: nil)
|
9
|
-
@attributes = {}
|
10
|
-
|
11
|
-
@attributes[:contents] = contents
|
12
|
-
@attributes[:range] = range if range
|
13
|
-
|
14
|
-
@attributes.freeze
|
15
|
-
end
|
16
|
-
|
17
|
-
#
|
18
|
-
# The hover's content
|
19
|
-
#
|
20
|
-
# @return [string | { language: string; value: string; } | MarkedString[]]
|
21
|
-
def contents
|
22
|
-
attributes.fetch(:contents)
|
23
|
-
end
|
24
|
-
|
25
|
-
#
|
26
|
-
# An optional range is a range inside a text document
|
27
|
-
# that is used to visualize a hover, e.g. by changing the background color.
|
28
|
-
#
|
29
|
-
# @return [Range]
|
30
|
-
def range
|
31
|
-
attributes.fetch(:range)
|
32
|
-
end
|
33
|
-
|
34
|
-
attr_reader :attributes
|
35
|
-
|
36
|
-
def to_json(*args)
|
37
|
-
attributes.to_json(*args)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
#
|
5
|
-
# Known error codes for an `InitializeError`;
|
6
|
-
#
|
7
|
-
class InitializeError
|
8
|
-
def initialize(retry:)
|
9
|
-
@attributes = {}
|
10
|
-
|
11
|
-
@attributes[:retry] = binding.local_variable_get(:retry)
|
12
|
-
|
13
|
-
@attributes.freeze
|
14
|
-
end
|
15
|
-
|
16
|
-
#
|
17
|
-
# Indicates whether the client execute the following retry logic:
|
18
|
-
# (1) show the message provided by the ResponseError to the user
|
19
|
-
# (2) user selects retry or cancel
|
20
|
-
# (3) if user selected retry the initialize method is sent again.
|
21
|
-
#
|
22
|
-
# @return [boolean]
|
23
|
-
def retry
|
24
|
-
attributes.fetch(:retry)
|
25
|
-
end
|
26
|
-
|
27
|
-
attr_reader :attributes
|
28
|
-
|
29
|
-
def to_json(*args)
|
30
|
-
attributes.to_json(*args)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class InitializeParams
|
5
|
-
def initialize(process_id:, root_path: nil, root_uri:, initialization_options: nil, capabilities:, trace: nil)
|
6
|
-
@attributes = {}
|
7
|
-
|
8
|
-
@attributes[:processId] = process_id
|
9
|
-
@attributes[:rootPath] = root_path if root_path
|
10
|
-
@attributes[:rootUri] = root_uri
|
11
|
-
@attributes[:initializationOptions] = initialization_options if initialization_options
|
12
|
-
@attributes[:capabilities] = capabilities
|
13
|
-
@attributes[:trace] = trace if trace
|
14
|
-
|
15
|
-
@attributes.freeze
|
16
|
-
end
|
17
|
-
|
18
|
-
#
|
19
|
-
# The process Id of the parent process that started
|
20
|
-
# the server. Is null if the process has not been started by another process.
|
21
|
-
# If the parent process is not alive then the server should exit (see exit notification) its process.
|
22
|
-
#
|
23
|
-
# @return [number]
|
24
|
-
def process_id
|
25
|
-
attributes.fetch(:processId)
|
26
|
-
end
|
27
|
-
|
28
|
-
#
|
29
|
-
# The rootPath of the workspace. Is null
|
30
|
-
# if no folder is open.
|
31
|
-
#
|
32
|
-
# @return [string]
|
33
|
-
def root_path
|
34
|
-
attributes.fetch(:rootPath)
|
35
|
-
end
|
36
|
-
|
37
|
-
#
|
38
|
-
# The rootUri of the workspace. Is null if no
|
39
|
-
# folder is open. If both `rootPath` and `rootUri` are set
|
40
|
-
# `rootUri` wins.
|
41
|
-
#
|
42
|
-
# @return [string]
|
43
|
-
def root_uri
|
44
|
-
attributes.fetch(:rootUri)
|
45
|
-
end
|
46
|
-
|
47
|
-
#
|
48
|
-
# User provided initialization options.
|
49
|
-
#
|
50
|
-
# @return [any]
|
51
|
-
def initialization_options
|
52
|
-
attributes.fetch(:initializationOptions)
|
53
|
-
end
|
54
|
-
|
55
|
-
#
|
56
|
-
# The capabilities provided by the client (editor or tool)
|
57
|
-
#
|
58
|
-
# @return [ClientCapabilities]
|
59
|
-
def capabilities
|
60
|
-
attributes.fetch(:capabilities)
|
61
|
-
end
|
62
|
-
|
63
|
-
#
|
64
|
-
# The initial trace setting. If omitted trace is disabled ('off').
|
65
|
-
#
|
66
|
-
# @return ["off" | "messages" | "verbose"]
|
67
|
-
def trace
|
68
|
-
attributes.fetch(:trace)
|
69
|
-
end
|
70
|
-
|
71
|
-
attr_reader :attributes
|
72
|
-
|
73
|
-
def to_json(*args)
|
74
|
-
attributes.to_json(*args)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class InitializeResult
|
5
|
-
def initialize(capabilities:)
|
6
|
-
@attributes = {}
|
7
|
-
|
8
|
-
@attributes[:capabilities] = capabilities
|
9
|
-
|
10
|
-
@attributes.freeze
|
11
|
-
end
|
12
|
-
|
13
|
-
#
|
14
|
-
# The capabilities the language server provides.
|
15
|
-
#
|
16
|
-
# @return [ServerCapabilities]
|
17
|
-
def capabilities
|
18
|
-
attributes.fetch(:capabilities)
|
19
|
-
end
|
20
|
-
|
21
|
-
attr_reader :attributes
|
22
|
-
|
23
|
-
def to_json(*args)
|
24
|
-
attributes.to_json(*args)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class Location
|
5
|
-
def initialize(uri:, range:)
|
6
|
-
@attributes = {}
|
7
|
-
|
8
|
-
@attributes[:uri] = uri
|
9
|
-
@attributes[:range] = range
|
10
|
-
|
11
|
-
@attributes.freeze
|
12
|
-
end
|
13
|
-
|
14
|
-
# @return [string]
|
15
|
-
def uri
|
16
|
-
attributes.fetch(:uri)
|
17
|
-
end
|
18
|
-
|
19
|
-
# @return [Range]
|
20
|
-
def range
|
21
|
-
attributes.fetch(:range)
|
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
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class LogMessageParams
|
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
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class Message
|
5
|
-
def initialize(jsonrpc:)
|
6
|
-
@attributes = {}
|
7
|
-
|
8
|
-
@attributes[:jsonrpc] = jsonrpc
|
9
|
-
|
10
|
-
@attributes.freeze
|
11
|
-
end
|
12
|
-
|
13
|
-
# @return [string]
|
14
|
-
def jsonrpc
|
15
|
-
attributes.fetch(:jsonrpc)
|
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
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class MessageActionItem
|
5
|
-
def initialize(title:)
|
6
|
-
@attributes = {}
|
7
|
-
|
8
|
-
@attributes[:title] = title
|
9
|
-
|
10
|
-
@attributes.freeze
|
11
|
-
end
|
12
|
-
|
13
|
-
#
|
14
|
-
# A short title like 'Retry', 'Open Log' etc.
|
15
|
-
#
|
16
|
-
# @return [string]
|
17
|
-
def title
|
18
|
-
attributes.fetch(:title)
|
19
|
-
end
|
20
|
-
|
21
|
-
attr_reader :attributes
|
22
|
-
|
23
|
-
def to_json(*args)
|
24
|
-
attributes.to_json(*args)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class NotificationMessage
|
5
|
-
def initialize(method:, params: nil)
|
6
|
-
@attributes = {}
|
7
|
-
|
8
|
-
@attributes[:method] = method
|
9
|
-
@attributes[:params] = params if params
|
10
|
-
|
11
|
-
@attributes.freeze
|
12
|
-
end
|
13
|
-
|
14
|
-
#
|
15
|
-
# The method to be invoked.
|
16
|
-
#
|
17
|
-
# @return [string]
|
18
|
-
def method
|
19
|
-
attributes.fetch(:method)
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# The notification's params.
|
24
|
-
#
|
25
|
-
# @return [any]
|
26
|
-
def params
|
27
|
-
attributes.fetch(:params)
|
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
|
@@ -1,44 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
#
|
5
|
-
# Represents a parameter of a callable-signature. A parameter can
|
6
|
-
# have a label and a doc-comment.
|
7
|
-
#
|
8
|
-
class ParameterInformation
|
9
|
-
def initialize(label:, documentation: nil)
|
10
|
-
@attributes = {}
|
11
|
-
|
12
|
-
@attributes[:label] = label
|
13
|
-
@attributes[:documentation] = documentation if documentation
|
14
|
-
|
15
|
-
@attributes.freeze
|
16
|
-
end
|
17
|
-
|
18
|
-
#
|
19
|
-
# The label of this parameter. Will be shown in
|
20
|
-
# the UI.
|
21
|
-
#
|
22
|
-
# @return [string]
|
23
|
-
def label
|
24
|
-
attributes.fetch(:label)
|
25
|
-
end
|
26
|
-
|
27
|
-
#
|
28
|
-
# The human-readable doc-comment of this parameter. Will be shown
|
29
|
-
# in the UI but can be omitted.
|
30
|
-
#
|
31
|
-
# @return [string]
|
32
|
-
def documentation
|
33
|
-
attributes.fetch(:documentation)
|
34
|
-
end
|
35
|
-
|
36
|
-
attr_reader :attributes
|
37
|
-
|
38
|
-
def to_json(*args)
|
39
|
-
attributes.to_json(*args)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class Position
|
5
|
-
def initialize(line:, character:)
|
6
|
-
@attributes = {}
|
7
|
-
|
8
|
-
@attributes[:line] = line
|
9
|
-
@attributes[:character] = character
|
10
|
-
|
11
|
-
@attributes.freeze
|
12
|
-
end
|
13
|
-
|
14
|
-
#
|
15
|
-
# Line position in a document (zero-based).
|
16
|
-
#
|
17
|
-
# @return [number]
|
18
|
-
def line
|
19
|
-
attributes.fetch(:line)
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# Character offset on a line in a document (zero-based).
|
24
|
-
#
|
25
|
-
# @return [number]
|
26
|
-
def character
|
27
|
-
attributes.fetch(:character)
|
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
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class PublishDiagnosticsParams
|
5
|
-
def initialize(uri:, diagnostics:)
|
6
|
-
@attributes = {}
|
7
|
-
|
8
|
-
@attributes[:uri] = uri
|
9
|
-
@attributes[:diagnostics] = diagnostics
|
10
|
-
|
11
|
-
@attributes.freeze
|
12
|
-
end
|
13
|
-
|
14
|
-
#
|
15
|
-
# The URI for which diagnostic information is reported.
|
16
|
-
#
|
17
|
-
# @return [string]
|
18
|
-
def uri
|
19
|
-
attributes.fetch(:uri)
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# An array of diagnostic information items.
|
24
|
-
#
|
25
|
-
# @return [Diagnostic[]]
|
26
|
-
def diagnostics
|
27
|
-
attributes.fetch(:diagnostics)
|
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
|
@@ -1,38 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class Range
|
5
|
-
def initialize(start:, end:)
|
6
|
-
@attributes = {}
|
7
|
-
|
8
|
-
@attributes[:start] = start
|
9
|
-
@attributes[:end] = binding.local_variable_get(:end)
|
10
|
-
|
11
|
-
@attributes.freeze
|
12
|
-
end
|
13
|
-
|
14
|
-
#
|
15
|
-
# The range's start position.
|
16
|
-
#
|
17
|
-
# @return [Position]
|
18
|
-
def start
|
19
|
-
attributes.fetch(:start)
|
20
|
-
end
|
21
|
-
|
22
|
-
#
|
23
|
-
# The range's end position.
|
24
|
-
#
|
25
|
-
# @return [Position]
|
26
|
-
def end
|
27
|
-
attributes.fetch(:end)
|
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
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module LanguageServer
|
2
|
-
module Protocol
|
3
|
-
module Interfaces
|
4
|
-
class ReferenceContext
|
5
|
-
def initialize(include_declaration:)
|
6
|
-
@attributes = {}
|
7
|
-
|
8
|
-
@attributes[:includeDeclaration] = include_declaration
|
9
|
-
|
10
|
-
@attributes.freeze
|
11
|
-
end
|
12
|
-
|
13
|
-
#
|
14
|
-
# Include the declaration of the current symbol.
|
15
|
-
#
|
16
|
-
# @return [boolean]
|
17
|
-
def include_declaration
|
18
|
-
attributes.fetch(:includeDeclaration)
|
19
|
-
end
|
20
|
-
|
21
|
-
attr_reader :attributes
|
22
|
-
|
23
|
-
def to_json(*args)
|
24
|
-
attributes.to_json(*args)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,26 +0,0 @@
|
|
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
|