language_server-protocol 3.16.0.2 → 3.17.0.1
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/lib/language_server/protocol/constant/code_action_kind.rb +8 -0
- data/lib/language_server/protocol/constant/code_action_trigger_kind.rb +22 -0
- data/lib/language_server/protocol/constant/document_diagnostic_report_kind.rb +21 -0
- data/lib/language_server/protocol/constant/error_codes.rb +33 -2
- data/lib/language_server/protocol/constant/folding_range_kind.rb +24 -0
- data/lib/language_server/protocol/constant/{initialize_error.rb → initialize_error_codes.rb} +4 -4
- data/lib/language_server/protocol/constant/inlay_hint_kind.rb +19 -0
- data/lib/language_server/protocol/constant/moniker_kind.rb +24 -0
- data/lib/language_server/protocol/constant/notebook_cell_kind.rb +19 -0
- data/lib/language_server/protocol/constant/position_encoding_kind.rb +32 -0
- data/lib/language_server/protocol/constant/prepare_support_default_behavior.rb +1 -1
- data/lib/language_server/protocol/constant/semantic_token_modifiers.rb +18 -0
- data/lib/language_server/protocol/constant/semantic_token_types.rb +35 -0
- data/lib/language_server/protocol/constant/uniqueness_level.rb +31 -0
- data/lib/language_server/protocol/constant.rb +22 -2
- data/lib/language_server/protocol/interface/{apply_workspace_edit_response.rb → apply_workspace_edit_result.rb} +2 -2
- data/lib/language_server/protocol/interface/call_hierarchy_item.rb +1 -1
- data/lib/language_server/protocol/interface/client_capabilities.rb +13 -4
- data/lib/language_server/protocol/interface/code_action.rb +1 -1
- data/lib/language_server/protocol/interface/code_action_context.rb +10 -1
- data/lib/language_server/protocol/interface/code_lens.rb +1 -1
- data/lib/language_server/protocol/interface/color_presentation.rb +1 -1
- data/lib/language_server/protocol/interface/command.rb +1 -1
- data/lib/language_server/protocol/interface/completion_client_capabilities.rb +23 -3
- data/lib/language_server/protocol/interface/completion_item.rb +41 -9
- data/lib/language_server/protocol/interface/completion_item_label_details.rb +49 -0
- data/lib/language_server/protocol/interface/completion_list.rb +24 -2
- data/lib/language_server/protocol/interface/completion_options.rb +11 -1
- data/lib/language_server/protocol/interface/completion_registration_options.rb +11 -1
- data/lib/language_server/protocol/interface/create_file.rb +1 -1
- data/lib/language_server/protocol/interface/delete_file.rb +1 -1
- data/lib/language_server/protocol/interface/diagnostic_client_capabilities.rb +49 -0
- data/lib/language_server/protocol/interface/diagnostic_options.rb +64 -0
- data/lib/language_server/protocol/interface/diagnostic_registration_options.rb +84 -0
- data/lib/language_server/protocol/interface/diagnostic_server_cancellation_data.rb +33 -0
- data/lib/language_server/protocol/interface/diagnostic_workspace_client_capabilities.rb +42 -0
- data/lib/language_server/protocol/interface/did_change_configuration_params.rb +1 -1
- data/lib/language_server/protocol/interface/did_change_notebook_document_params.rb +56 -0
- data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +11 -1
- data/lib/language_server/protocol/interface/did_close_notebook_document_params.rb +46 -0
- data/lib/language_server/protocol/interface/did_open_notebook_document_params.rb +46 -0
- data/lib/language_server/protocol/interface/did_save_notebook_document_params.rb +36 -0
- data/lib/language_server/protocol/interface/document_diagnostic_params.rb +73 -0
- data/lib/language_server/protocol/interface/document_diagnostic_report_partial_result.rb +33 -0
- data/lib/language_server/protocol/interface/document_link.rb +1 -1
- data/lib/language_server/protocol/interface/document_on_type_formatting_options.rb +1 -1
- data/lib/language_server/protocol/interface/document_on_type_formatting_params.rb +9 -4
- data/lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb +1 -1
- data/lib/language_server/protocol/interface/document_symbol.rb +1 -1
- data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +1 -1
- data/lib/language_server/protocol/interface/execute_command_params.rb +1 -1
- data/lib/language_server/protocol/interface/execution_summary.rb +45 -0
- data/lib/language_server/protocol/interface/file_system_watcher.rb +3 -14
- data/lib/language_server/protocol/interface/folding_range.rb +12 -1
- data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +19 -1
- data/lib/language_server/protocol/interface/full_document_diagnostic_report.rb +56 -0
- data/lib/language_server/protocol/interface/hover_client_capabilities.rb +1 -1
- data/lib/language_server/protocol/interface/hover_result.rb +30 -0
- data/lib/language_server/protocol/interface/initialize_error.rb +0 -3
- data/lib/language_server/protocol/interface/initialize_params.rb +1 -1
- data/lib/language_server/protocol/interface/inlay_hint.rb +122 -0
- data/lib/language_server/protocol/interface/inlay_hint_client_capabilities.rb +46 -0
- data/lib/language_server/protocol/interface/inlay_hint_label_part.rb +79 -0
- data/lib/language_server/protocol/interface/inlay_hint_options.rb +43 -0
- data/lib/language_server/protocol/interface/inlay_hint_params.rb +54 -0
- data/lib/language_server/protocol/interface/inlay_hint_registration_options.rb +63 -0
- data/lib/language_server/protocol/interface/inlay_hint_workspace_client_capabilities.rb +42 -0
- data/lib/language_server/protocol/interface/inline_value_client_capabilities.rb +37 -0
- data/lib/language_server/protocol/interface/inline_value_context.rb +44 -0
- data/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb +52 -0
- data/lib/language_server/protocol/interface/inline_value_options.rb +33 -0
- data/lib/language_server/protocol/interface/inline_value_params.rb +64 -0
- data/lib/language_server/protocol/interface/inline_value_registration_options.rb +53 -0
- data/lib/language_server/protocol/interface/inline_value_text.rb +45 -0
- data/lib/language_server/protocol/interface/inline_value_variable_lookup.rb +61 -0
- data/lib/language_server/protocol/interface/inline_value_workspace_client_capabilities.rb +42 -0
- data/lib/language_server/protocol/interface/linked_editing_ranges.rb +5 -4
- data/lib/language_server/protocol/interface/location_link.rb +1 -1
- data/lib/language_server/protocol/interface/notebook_cell.rb +69 -0
- data/lib/language_server/protocol/interface/notebook_cell_array_change.rb +55 -0
- data/lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb +52 -0
- data/lib/language_server/protocol/interface/notebook_document.rb +74 -0
- data/lib/language_server/protocol/interface/notebook_document_change_event.rb +45 -0
- data/lib/language_server/protocol/interface/notebook_document_client_capabilities.rb +36 -0
- data/lib/language_server/protocol/interface/notebook_document_filter.rb +79 -0
- data/lib/language_server/protocol/interface/notebook_document_identifier.rb +36 -0
- data/lib/language_server/protocol/interface/notebook_document_sync_client_capabilities.rb +48 -0
- data/lib/language_server/protocol/interface/notebook_document_sync_options.rb +56 -0
- data/lib/language_server/protocol/interface/notebook_document_sync_registration_options.rb +56 -0
- data/lib/language_server/protocol/interface/position.rb +2 -3
- data/lib/language_server/protocol/interface/prepare_rename_params.rb +10 -1
- data/lib/language_server/protocol/interface/previous_result_id.rb +46 -0
- data/lib/language_server/protocol/interface/registration.rb +1 -1
- data/lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb +69 -0
- data/lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb +62 -0
- data/lib/language_server/protocol/interface/relative_pattern.rb +48 -0
- data/lib/language_server/protocol/interface/rename_client_capabilities.rb +1 -1
- data/lib/language_server/protocol/interface/rename_file.rb +1 -1
- data/lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb +29 -1
- data/lib/language_server/protocol/interface/server_capabilities.rb +62 -2
- data/lib/language_server/protocol/interface/signature_help.rb +2 -2
- data/lib/language_server/protocol/interface/symbol_information.rb +1 -1
- data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +37 -1
- data/lib/language_server/protocol/interface/text_document_content_change_event.rb +2 -2
- data/lib/language_server/protocol/interface/text_document_sync_options.rb +2 -0
- data/lib/language_server/protocol/interface/type_hierarchy_item.rb +102 -0
- data/lib/language_server/protocol/interface/type_hierarchy_options.rb +30 -0
- data/lib/language_server/protocol/interface/type_hierarchy_prepare_params.rb +51 -0
- data/lib/language_server/protocol/interface/type_hierarchy_registration_options.rb +50 -0
- data/lib/language_server/protocol/interface/type_hierarchy_subtypes_params.rb +49 -0
- data/lib/language_server/protocol/interface/type_hierarchy_supertypes_params.rb +49 -0
- data/lib/language_server/protocol/interface/unchanged_document_diagnostic_report.rb +50 -0
- data/lib/language_server/protocol/interface/{markdown_client_capabilities.rb → versioned_notebook_document_identifier.rb} +12 -12
- data/lib/language_server/protocol/interface/work_done_progress_report.rb +1 -1
- data/lib/language_server/protocol/interface/workspace_diagnostic_params.rb +65 -0
- data/lib/language_server/protocol/interface/workspace_diagnostic_report.rb +33 -0
- data/lib/language_server/protocol/interface/workspace_diagnostic_report_partial_result.rb +33 -0
- data/lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb +75 -0
- data/lib/language_server/protocol/interface/workspace_symbol.rb +89 -0
- data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +14 -3
- data/lib/language_server/protocol/interface/workspace_symbol_options.rb +11 -1
- data/lib/language_server/protocol/interface/workspace_symbol_registration_options.rb +11 -1
- data/lib/language_server/protocol/interface/workspace_unchanged_document_diagnostic_report.rb +68 -0
- data/lib/language_server/protocol/interface.rb +124 -4
- data/lib/language_server/protocol/transport/io/reader.rb +7 -24
- data/lib/language_server/protocol/version.rb +1 -1
- metadata +75 -20
@@ -0,0 +1,48 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Notebook specific client capabilities.
|
6
|
+
#
|
7
|
+
class NotebookDocumentSyncClientCapabilities
|
8
|
+
def initialize(dynamic_registration: nil, execution_summary_support: nil)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
|
12
|
+
@attributes[:executionSummarySupport] = execution_summary_support if execution_summary_support
|
13
|
+
|
14
|
+
@attributes.freeze
|
15
|
+
end
|
16
|
+
|
17
|
+
#
|
18
|
+
# Whether implementation supports dynamic registration. If this is
|
19
|
+
# set to `true` the client supports the new
|
20
|
+
# `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
|
21
|
+
# return value for the corresponding server capability as well.
|
22
|
+
#
|
23
|
+
# @return [boolean]
|
24
|
+
def dynamic_registration
|
25
|
+
attributes.fetch(:dynamicRegistration)
|
26
|
+
end
|
27
|
+
|
28
|
+
#
|
29
|
+
# The client supports sending execution summary data per cell.
|
30
|
+
#
|
31
|
+
# @return [boolean]
|
32
|
+
def execution_summary_support
|
33
|
+
attributes.fetch(:executionSummarySupport)
|
34
|
+
end
|
35
|
+
|
36
|
+
attr_reader :attributes
|
37
|
+
|
38
|
+
def to_hash
|
39
|
+
attributes
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_json(*args)
|
43
|
+
to_hash.to_json(*args)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Options specific to a notebook plus its cells
|
6
|
+
# to be synced to the server.
|
7
|
+
#
|
8
|
+
# If a selector provides a notebook document
|
9
|
+
# filter but no cell selector all cells of a
|
10
|
+
# matching notebook document will be synced.
|
11
|
+
#
|
12
|
+
# If a selector provides no notebook document
|
13
|
+
# filter but only a cell selector all notebook
|
14
|
+
# documents that contain at least one matching
|
15
|
+
# cell will be synced.
|
16
|
+
#
|
17
|
+
class NotebookDocumentSyncOptions
|
18
|
+
def initialize(notebook_selector:, save: nil)
|
19
|
+
@attributes = {}
|
20
|
+
|
21
|
+
@attributes[:notebookSelector] = notebook_selector
|
22
|
+
@attributes[:save] = save if save
|
23
|
+
|
24
|
+
@attributes.freeze
|
25
|
+
end
|
26
|
+
|
27
|
+
#
|
28
|
+
# The notebooks to be synced
|
29
|
+
#
|
30
|
+
# @return [({ notebook: string | NotebookDocumentFilter; cells?: { language: string; }[]; } | { notebook?: string | NotebookDocumentFilter; cells: { ...; }[]; })[]]
|
31
|
+
def notebook_selector
|
32
|
+
attributes.fetch(:notebookSelector)
|
33
|
+
end
|
34
|
+
|
35
|
+
#
|
36
|
+
# Whether save notification should be forwarded to
|
37
|
+
# the server. Will only be honored if mode === `notebook`.
|
38
|
+
#
|
39
|
+
# @return [boolean]
|
40
|
+
def save
|
41
|
+
attributes.fetch(:save)
|
42
|
+
end
|
43
|
+
|
44
|
+
attr_reader :attributes
|
45
|
+
|
46
|
+
def to_hash
|
47
|
+
attributes
|
48
|
+
end
|
49
|
+
|
50
|
+
def to_json(*args)
|
51
|
+
to_hash.to_json(*args)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Registration options specific to a notebook.
|
6
|
+
#
|
7
|
+
class NotebookDocumentSyncRegistrationOptions
|
8
|
+
def initialize(notebook_selector:, save: nil, id: nil)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:notebookSelector] = notebook_selector
|
12
|
+
@attributes[:save] = save if save
|
13
|
+
@attributes[:id] = id if id
|
14
|
+
|
15
|
+
@attributes.freeze
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
# The notebooks to be synced
|
20
|
+
#
|
21
|
+
# @return [({ notebook: string | NotebookDocumentFilter; cells?: { language: string; }[]; } | { notebook?: string | NotebookDocumentFilter; cells: { ...; }[]; })[]]
|
22
|
+
def notebook_selector
|
23
|
+
attributes.fetch(:notebookSelector)
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
# Whether save notification should be forwarded to
|
28
|
+
# the server. Will only be honored if mode === `notebook`.
|
29
|
+
#
|
30
|
+
# @return [boolean]
|
31
|
+
def save
|
32
|
+
attributes.fetch(:save)
|
33
|
+
end
|
34
|
+
|
35
|
+
#
|
36
|
+
# The id used to register the request. The id can be used to deregister
|
37
|
+
# the request again. See also Registration#id.
|
38
|
+
#
|
39
|
+
# @return [string]
|
40
|
+
def id
|
41
|
+
attributes.fetch(:id)
|
42
|
+
end
|
43
|
+
|
44
|
+
attr_reader :attributes
|
45
|
+
|
46
|
+
def to_hash
|
47
|
+
attributes
|
48
|
+
end
|
49
|
+
|
50
|
+
def to_json(*args)
|
51
|
+
to_hash.to_json(*args)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -20,9 +20,8 @@ module LanguageServer
|
|
20
20
|
end
|
21
21
|
|
22
22
|
#
|
23
|
-
# Character offset on a line in a document (zero-based).
|
24
|
-
#
|
25
|
-
# the gap between the `character` and `character + 1`.
|
23
|
+
# Character offset on a line in a document (zero-based). The meaning of this
|
24
|
+
# offset is determined by the negotiated `PositionEncodingKind`.
|
26
25
|
#
|
27
26
|
# If the character value is greater than the line length it defaults back
|
28
27
|
# to the line length.
|
@@ -2,11 +2,12 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
class PrepareRenameParams
|
5
|
-
def initialize(text_document:, position:)
|
5
|
+
def initialize(text_document:, position:, work_done_token: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
8
|
@attributes[:textDocument] = text_document
|
9
9
|
@attributes[:position] = position
|
10
|
+
@attributes[:workDoneToken] = work_done_token if work_done_token
|
10
11
|
|
11
12
|
@attributes.freeze
|
12
13
|
end
|
@@ -27,6 +28,14 @@ module LanguageServer
|
|
27
28
|
attributes.fetch(:position)
|
28
29
|
end
|
29
30
|
|
31
|
+
#
|
32
|
+
# An optional token that a server can use to report work done progress.
|
33
|
+
#
|
34
|
+
# @return [ProgressToken]
|
35
|
+
def work_done_token
|
36
|
+
attributes.fetch(:workDoneToken)
|
37
|
+
end
|
38
|
+
|
30
39
|
attr_reader :attributes
|
31
40
|
|
32
41
|
def to_hash
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A previous result id in a workspace pull request.
|
6
|
+
#
|
7
|
+
class PreviousResultId
|
8
|
+
def initialize(uri:, value:)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:uri] = uri
|
12
|
+
@attributes[:value] = value
|
13
|
+
|
14
|
+
@attributes.freeze
|
15
|
+
end
|
16
|
+
|
17
|
+
#
|
18
|
+
# The URI for which the client knows a
|
19
|
+
# result id.
|
20
|
+
#
|
21
|
+
# @return [string]
|
22
|
+
def uri
|
23
|
+
attributes.fetch(:uri)
|
24
|
+
end
|
25
|
+
|
26
|
+
#
|
27
|
+
# The value of the previous result id.
|
28
|
+
#
|
29
|
+
# @return [string]
|
30
|
+
def value
|
31
|
+
attributes.fetch(:value)
|
32
|
+
end
|
33
|
+
|
34
|
+
attr_reader :attributes
|
35
|
+
|
36
|
+
def to_hash
|
37
|
+
attributes
|
38
|
+
end
|
39
|
+
|
40
|
+
def to_json(*args)
|
41
|
+
to_hash.to_json(*args)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A full diagnostic report with a set of related documents.
|
6
|
+
#
|
7
|
+
class RelatedFullDocumentDiagnosticReport
|
8
|
+
def initialize(kind:, result_id: nil, items:, related_documents: nil)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:kind] = kind
|
12
|
+
@attributes[:resultId] = result_id if result_id
|
13
|
+
@attributes[:items] = items
|
14
|
+
@attributes[:relatedDocuments] = related_documents if related_documents
|
15
|
+
|
16
|
+
@attributes.freeze
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# A full document diagnostic report.
|
21
|
+
#
|
22
|
+
# @return [any]
|
23
|
+
def kind
|
24
|
+
attributes.fetch(:kind)
|
25
|
+
end
|
26
|
+
|
27
|
+
#
|
28
|
+
# An optional result id. If provided it will
|
29
|
+
# be sent on the next diagnostic request for the
|
30
|
+
# same document.
|
31
|
+
#
|
32
|
+
# @return [string]
|
33
|
+
def result_id
|
34
|
+
attributes.fetch(:resultId)
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# The actual items.
|
39
|
+
#
|
40
|
+
# @return [Diagnostic[]]
|
41
|
+
def items
|
42
|
+
attributes.fetch(:items)
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# Diagnostics of related documents. This information is useful
|
47
|
+
# in programming languages where code in a file A can generate
|
48
|
+
# diagnostics in a file B which A depends on. An example of
|
49
|
+
# such a language is C/C++ where marco definitions in a file
|
50
|
+
# a.cpp and result in errors in a header file b.hpp.
|
51
|
+
#
|
52
|
+
# @return [{ [uri: string]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport; }]
|
53
|
+
def related_documents
|
54
|
+
attributes.fetch(:relatedDocuments)
|
55
|
+
end
|
56
|
+
|
57
|
+
attr_reader :attributes
|
58
|
+
|
59
|
+
def to_hash
|
60
|
+
attributes
|
61
|
+
end
|
62
|
+
|
63
|
+
def to_json(*args)
|
64
|
+
to_hash.to_json(*args)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# An unchanged diagnostic report with a set of related documents.
|
6
|
+
#
|
7
|
+
class RelatedUnchangedDocumentDiagnosticReport
|
8
|
+
def initialize(kind:, result_id:, related_documents: nil)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:kind] = kind
|
12
|
+
@attributes[:resultId] = result_id
|
13
|
+
@attributes[:relatedDocuments] = related_documents if related_documents
|
14
|
+
|
15
|
+
@attributes.freeze
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
# A document diagnostic report indicating
|
20
|
+
# no changes to the last result. A server can
|
21
|
+
# only return `unchanged` if result ids are
|
22
|
+
# provided.
|
23
|
+
#
|
24
|
+
# @return [any]
|
25
|
+
def kind
|
26
|
+
attributes.fetch(:kind)
|
27
|
+
end
|
28
|
+
|
29
|
+
#
|
30
|
+
# A result id which will be sent on the next
|
31
|
+
# diagnostic request for the same document.
|
32
|
+
#
|
33
|
+
# @return [string]
|
34
|
+
def result_id
|
35
|
+
attributes.fetch(:resultId)
|
36
|
+
end
|
37
|
+
|
38
|
+
#
|
39
|
+
# Diagnostics of related documents. This information is useful
|
40
|
+
# in programming languages where code in a file A can generate
|
41
|
+
# diagnostics in a file B which A depends on. An example of
|
42
|
+
# such a language is C/C++ where marco definitions in a file
|
43
|
+
# a.cpp and result in errors in a header file b.hpp.
|
44
|
+
#
|
45
|
+
# @return [{ [uri: string]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport; }]
|
46
|
+
def related_documents
|
47
|
+
attributes.fetch(:relatedDocuments)
|
48
|
+
end
|
49
|
+
|
50
|
+
attr_reader :attributes
|
51
|
+
|
52
|
+
def to_hash
|
53
|
+
attributes
|
54
|
+
end
|
55
|
+
|
56
|
+
def to_json(*args)
|
57
|
+
to_hash.to_json(*args)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A relative pattern is a helper to construct glob patterns that are matched
|
6
|
+
# relatively to a base URI. The common value for a `baseUri` is a workspace
|
7
|
+
# folder root, but it can be another absolute URI as well.
|
8
|
+
#
|
9
|
+
class RelativePattern
|
10
|
+
def initialize(base_uri:, pattern:)
|
11
|
+
@attributes = {}
|
12
|
+
|
13
|
+
@attributes[:baseUri] = base_uri
|
14
|
+
@attributes[:pattern] = pattern
|
15
|
+
|
16
|
+
@attributes.freeze
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# A workspace folder or a base URI to which this pattern will be matched
|
21
|
+
# against relatively.
|
22
|
+
#
|
23
|
+
# @return [string | WorkspaceFolder]
|
24
|
+
def base_uri
|
25
|
+
attributes.fetch(:baseUri)
|
26
|
+
end
|
27
|
+
|
28
|
+
#
|
29
|
+
# The actual glob pattern;
|
30
|
+
#
|
31
|
+
# @return [string]
|
32
|
+
def pattern
|
33
|
+
attributes.fetch(:pattern)
|
34
|
+
end
|
35
|
+
|
36
|
+
attr_reader :attributes
|
37
|
+
|
38
|
+
def to_hash
|
39
|
+
attributes
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_json(*args)
|
43
|
+
to_hash.to_json(*args)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -2,7 +2,7 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
class SemanticTokensClientCapabilities
|
5
|
-
def initialize(dynamic_registration: nil, requests:, token_types:, token_modifiers:, formats:, overlapping_token_support: nil, multiline_token_support: nil)
|
5
|
+
def initialize(dynamic_registration: nil, requests:, token_types:, token_modifiers:, formats:, overlapping_token_support: nil, multiline_token_support: nil, server_cancel_support: nil, augments_syntax_tokens: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
8
|
@attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
|
@@ -12,6 +12,8 @@ module LanguageServer
|
|
12
12
|
@attributes[:formats] = formats
|
13
13
|
@attributes[:overlappingTokenSupport] = overlapping_token_support if overlapping_token_support
|
14
14
|
@attributes[:multilineTokenSupport] = multiline_token_support if multiline_token_support
|
15
|
+
@attributes[:serverCancelSupport] = server_cancel_support if server_cancel_support
|
16
|
+
@attributes[:augmentsSyntaxTokens] = augments_syntax_tokens if augments_syntax_tokens
|
15
17
|
|
16
18
|
@attributes.freeze
|
17
19
|
end
|
@@ -82,6 +84,32 @@ module LanguageServer
|
|
82
84
|
attributes.fetch(:multilineTokenSupport)
|
83
85
|
end
|
84
86
|
|
87
|
+
#
|
88
|
+
# Whether the client allows the server to actively cancel a
|
89
|
+
# semantic token request, e.g. supports returning
|
90
|
+
# ErrorCodes.ServerCancelled. If a server does the client
|
91
|
+
# needs to retrigger the request.
|
92
|
+
#
|
93
|
+
# @return [boolean]
|
94
|
+
def server_cancel_support
|
95
|
+
attributes.fetch(:serverCancelSupport)
|
96
|
+
end
|
97
|
+
|
98
|
+
#
|
99
|
+
# Whether the client uses semantic tokens to augment existing
|
100
|
+
# syntax tokens. If set to `true` client side created syntax
|
101
|
+
# tokens and semantic tokens are both used for colorization. If
|
102
|
+
# set to `false` the client only uses the returned semantic tokens
|
103
|
+
# for colorization.
|
104
|
+
#
|
105
|
+
# If the value is `undefined` then the client behavior is not
|
106
|
+
# specified.
|
107
|
+
#
|
108
|
+
# @return [boolean]
|
109
|
+
def augments_syntax_tokens
|
110
|
+
attributes.fetch(:augmentsSyntaxTokens)
|
111
|
+
end
|
112
|
+
|
85
113
|
attr_reader :attributes
|
86
114
|
|
87
115
|
def to_hash
|
@@ -2,10 +2,12 @@ module LanguageServer
|
|
2
2
|
module Protocol
|
3
3
|
module Interface
|
4
4
|
class ServerCapabilities
|
5
|
-
def initialize(text_document_sync: nil, completion_provider: nil, hover_provider: nil, signature_help_provider: nil, declaration_provider: nil, definition_provider: nil, type_definition_provider: nil, implementation_provider: nil, references_provider: nil, document_highlight_provider: nil, document_symbol_provider: nil, code_action_provider: nil, code_lens_provider: nil, document_link_provider: nil, color_provider: nil, document_formatting_provider: nil, document_range_formatting_provider: nil, document_on_type_formatting_provider: nil, rename_provider: nil, folding_range_provider: nil, execute_command_provider: nil, selection_range_provider: nil, linked_editing_range_provider: nil, call_hierarchy_provider: nil, semantic_tokens_provider: nil, moniker_provider: nil, workspace_symbol_provider: nil, workspace: nil, experimental: nil)
|
5
|
+
def initialize(position_encoding: nil, text_document_sync: nil, notebook_document_sync: nil, completion_provider: nil, hover_provider: nil, signature_help_provider: nil, declaration_provider: nil, definition_provider: nil, type_definition_provider: nil, implementation_provider: nil, references_provider: nil, document_highlight_provider: nil, document_symbol_provider: nil, code_action_provider: nil, code_lens_provider: nil, document_link_provider: nil, color_provider: nil, document_formatting_provider: nil, document_range_formatting_provider: nil, document_on_type_formatting_provider: nil, rename_provider: nil, folding_range_provider: nil, execute_command_provider: nil, selection_range_provider: nil, linked_editing_range_provider: nil, call_hierarchy_provider: nil, semantic_tokens_provider: nil, moniker_provider: nil, type_hierarchy_provider: nil, inline_value_provider: nil, inlay_hint_provider: nil, diagnostic_provider: nil, workspace_symbol_provider: nil, workspace: nil, experimental: nil)
|
6
6
|
@attributes = {}
|
7
7
|
|
8
|
+
@attributes[:positionEncoding] = position_encoding if position_encoding
|
8
9
|
@attributes[:textDocumentSync] = text_document_sync if text_document_sync
|
10
|
+
@attributes[:notebookDocumentSync] = notebook_document_sync if notebook_document_sync
|
9
11
|
@attributes[:completionProvider] = completion_provider if completion_provider
|
10
12
|
@attributes[:hoverProvider] = hover_provider if hover_provider
|
11
13
|
@attributes[:signatureHelpProvider] = signature_help_provider if signature_help_provider
|
@@ -31,6 +33,10 @@ module LanguageServer
|
|
31
33
|
@attributes[:callHierarchyProvider] = call_hierarchy_provider if call_hierarchy_provider
|
32
34
|
@attributes[:semanticTokensProvider] = semantic_tokens_provider if semantic_tokens_provider
|
33
35
|
@attributes[:monikerProvider] = moniker_provider if moniker_provider
|
36
|
+
@attributes[:typeHierarchyProvider] = type_hierarchy_provider if type_hierarchy_provider
|
37
|
+
@attributes[:inlineValueProvider] = inline_value_provider if inline_value_provider
|
38
|
+
@attributes[:inlayHintProvider] = inlay_hint_provider if inlay_hint_provider
|
39
|
+
@attributes[:diagnosticProvider] = diagnostic_provider if diagnostic_provider
|
34
40
|
@attributes[:workspaceSymbolProvider] = workspace_symbol_provider if workspace_symbol_provider
|
35
41
|
@attributes[:workspace] = workspace if workspace
|
36
42
|
@attributes[:experimental] = experimental if experimental
|
@@ -38,6 +44,20 @@ module LanguageServer
|
|
38
44
|
@attributes.freeze
|
39
45
|
end
|
40
46
|
|
47
|
+
#
|
48
|
+
# The position encoding the server picked from the encodings offered
|
49
|
+
# by the client via the client capability `general.positionEncodings`.
|
50
|
+
#
|
51
|
+
# If the client didn't provide any position encodings the only valid
|
52
|
+
# value that a server can return is 'utf-16'.
|
53
|
+
#
|
54
|
+
# If omitted it defaults to 'utf-16'.
|
55
|
+
#
|
56
|
+
# @return [string]
|
57
|
+
def position_encoding
|
58
|
+
attributes.fetch(:positionEncoding)
|
59
|
+
end
|
60
|
+
|
41
61
|
#
|
42
62
|
# Defines how text documents are synced. Is either a detailed structure
|
43
63
|
# defining each notification or for backwards compatibility the
|
@@ -49,6 +69,14 @@ module LanguageServer
|
|
49
69
|
attributes.fetch(:textDocumentSync)
|
50
70
|
end
|
51
71
|
|
72
|
+
#
|
73
|
+
# Defines how notebook documents are synced.
|
74
|
+
#
|
75
|
+
# @return [NotebookDocumentSyncOptions | NotebookDocumentSyncRegistrationOptions]
|
76
|
+
def notebook_document_sync
|
77
|
+
attributes.fetch(:notebookDocumentSync)
|
78
|
+
end
|
79
|
+
|
52
80
|
#
|
53
81
|
# The server provides completion support.
|
54
82
|
#
|
@@ -253,6 +281,38 @@ module LanguageServer
|
|
253
281
|
attributes.fetch(:monikerProvider)
|
254
282
|
end
|
255
283
|
|
284
|
+
#
|
285
|
+
# The server provides type hierarchy support.
|
286
|
+
#
|
287
|
+
# @return [boolean | TypeHierarchyOptions | TypeHierarchyRegistrationOptions]
|
288
|
+
def type_hierarchy_provider
|
289
|
+
attributes.fetch(:typeHierarchyProvider)
|
290
|
+
end
|
291
|
+
|
292
|
+
#
|
293
|
+
# The server provides inline values.
|
294
|
+
#
|
295
|
+
# @return [boolean | InlineValueOptions | InlineValueRegistrationOptions]
|
296
|
+
def inline_value_provider
|
297
|
+
attributes.fetch(:inlineValueProvider)
|
298
|
+
end
|
299
|
+
|
300
|
+
#
|
301
|
+
# The server provides inlay hints.
|
302
|
+
#
|
303
|
+
# @return [boolean | InlayHintOptions | InlayHintRegistrationOptions]
|
304
|
+
def inlay_hint_provider
|
305
|
+
attributes.fetch(:inlayHintProvider)
|
306
|
+
end
|
307
|
+
|
308
|
+
#
|
309
|
+
# The server has support for pull model diagnostics.
|
310
|
+
#
|
311
|
+
# @return [DiagnosticOptions | DiagnosticRegistrationOptions]
|
312
|
+
def diagnostic_provider
|
313
|
+
attributes.fetch(:diagnosticProvider)
|
314
|
+
end
|
315
|
+
|
256
316
|
#
|
257
317
|
# The server provides workspace symbol support.
|
258
318
|
#
|
@@ -272,7 +332,7 @@ module LanguageServer
|
|
272
332
|
#
|
273
333
|
# Experimental server capabilities.
|
274
334
|
#
|
275
|
-
# @return [
|
335
|
+
# @return [LSPAny]
|
276
336
|
def experimental
|
277
337
|
attributes.fetch(:experimental)
|
278
338
|
end
|
@@ -28,8 +28,8 @@ module LanguageServer
|
|
28
28
|
|
29
29
|
#
|
30
30
|
# The active signature. If omitted or the value lies outside the
|
31
|
-
# range of `signatures` the value defaults to zero or is
|
32
|
-
# the `SignatureHelp`
|
31
|
+
# range of `signatures` the value defaults to zero or is ignore if
|
32
|
+
# the `SignatureHelp` as no signatures.
|
33
33
|
#
|
34
34
|
# Whenever possible implementors should make an active decision about
|
35
35
|
# the active signature and shouldn't rely on a default value.
|