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,53 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Inline value options used during static or dynamic registration.
|
6
|
+
#
|
7
|
+
class InlineValueRegistrationOptions
|
8
|
+
def initialize(work_done_progress: nil, document_selector:, id: nil)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
|
12
|
+
@attributes[:documentSelector] = document_selector
|
13
|
+
@attributes[:id] = id if id
|
14
|
+
|
15
|
+
@attributes.freeze
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [boolean]
|
19
|
+
def work_done_progress
|
20
|
+
attributes.fetch(:workDoneProgress)
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# A document selector to identify the scope of the registration. If set to
|
25
|
+
# null the document selector provided on the client side will be used.
|
26
|
+
#
|
27
|
+
# @return [DocumentSelector]
|
28
|
+
def document_selector
|
29
|
+
attributes.fetch(:documentSelector)
|
30
|
+
end
|
31
|
+
|
32
|
+
#
|
33
|
+
# The id used to register the request. The id can be used to deregister
|
34
|
+
# the request again. See also Registration#id.
|
35
|
+
#
|
36
|
+
# @return [string]
|
37
|
+
def id
|
38
|
+
attributes.fetch(:id)
|
39
|
+
end
|
40
|
+
|
41
|
+
attr_reader :attributes
|
42
|
+
|
43
|
+
def to_hash
|
44
|
+
attributes
|
45
|
+
end
|
46
|
+
|
47
|
+
def to_json(*args)
|
48
|
+
to_hash.to_json(*args)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Provide inline value as text.
|
6
|
+
#
|
7
|
+
class InlineValueText
|
8
|
+
def initialize(range:, text:)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:range] = range
|
12
|
+
@attributes[:text] = text
|
13
|
+
|
14
|
+
@attributes.freeze
|
15
|
+
end
|
16
|
+
|
17
|
+
#
|
18
|
+
# The document range for which the inline value applies.
|
19
|
+
#
|
20
|
+
# @return [Range]
|
21
|
+
def range
|
22
|
+
attributes.fetch(:range)
|
23
|
+
end
|
24
|
+
|
25
|
+
#
|
26
|
+
# The text of the inline value.
|
27
|
+
#
|
28
|
+
# @return [string]
|
29
|
+
def text
|
30
|
+
attributes.fetch(:text)
|
31
|
+
end
|
32
|
+
|
33
|
+
attr_reader :attributes
|
34
|
+
|
35
|
+
def to_hash
|
36
|
+
attributes
|
37
|
+
end
|
38
|
+
|
39
|
+
def to_json(*args)
|
40
|
+
to_hash.to_json(*args)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Provide inline value through a variable lookup.
|
6
|
+
#
|
7
|
+
# If only a range is specified, the variable name will be extracted from
|
8
|
+
# the underlying document.
|
9
|
+
#
|
10
|
+
# An optional variable name can be used to override the extracted name.
|
11
|
+
#
|
12
|
+
class InlineValueVariableLookup
|
13
|
+
def initialize(range:, variable_name: nil, case_sensitive_lookup:)
|
14
|
+
@attributes = {}
|
15
|
+
|
16
|
+
@attributes[:range] = range
|
17
|
+
@attributes[:variableName] = variable_name if variable_name
|
18
|
+
@attributes[:caseSensitiveLookup] = case_sensitive_lookup
|
19
|
+
|
20
|
+
@attributes.freeze
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# The document range for which the inline value applies.
|
25
|
+
# The range is used to extract the variable name from the underlying
|
26
|
+
# document.
|
27
|
+
#
|
28
|
+
# @return [Range]
|
29
|
+
def range
|
30
|
+
attributes.fetch(:range)
|
31
|
+
end
|
32
|
+
|
33
|
+
#
|
34
|
+
# If specified the name of the variable to look up.
|
35
|
+
#
|
36
|
+
# @return [string]
|
37
|
+
def variable_name
|
38
|
+
attributes.fetch(:variableName)
|
39
|
+
end
|
40
|
+
|
41
|
+
#
|
42
|
+
# How to perform the lookup.
|
43
|
+
#
|
44
|
+
# @return [boolean]
|
45
|
+
def case_sensitive_lookup
|
46
|
+
attributes.fetch(:caseSensitiveLookup)
|
47
|
+
end
|
48
|
+
|
49
|
+
attr_reader :attributes
|
50
|
+
|
51
|
+
def to_hash
|
52
|
+
attributes
|
53
|
+
end
|
54
|
+
|
55
|
+
def to_json(*args)
|
56
|
+
to_hash.to_json(*args)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Client workspace capabilities specific to inline values.
|
6
|
+
#
|
7
|
+
class InlineValueWorkspaceClientCapabilities
|
8
|
+
def initialize(refresh_support: nil)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:refreshSupport] = refresh_support if refresh_support
|
12
|
+
|
13
|
+
@attributes.freeze
|
14
|
+
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# Whether the client implementation supports a refresh request sent from
|
18
|
+
# the server to the client.
|
19
|
+
#
|
20
|
+
# Note that this event is global and will force the client to refresh all
|
21
|
+
# inline values currently shown. It should be used with absolute care and
|
22
|
+
# is useful for situation where a server for example detect a project wide
|
23
|
+
# change that requires such a calculation.
|
24
|
+
#
|
25
|
+
# @return [boolean]
|
26
|
+
def refresh_support
|
27
|
+
attributes.fetch(:refreshSupport)
|
28
|
+
end
|
29
|
+
|
30
|
+
attr_reader :attributes
|
31
|
+
|
32
|
+
def to_hash
|
33
|
+
attributes
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_json(*args)
|
37
|
+
to_hash.to_json(*args)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -13,7 +13,8 @@ module LanguageServer
|
|
13
13
|
|
14
14
|
#
|
15
15
|
# A list of ranges that can be renamed together. The ranges must have
|
16
|
-
# identical length and contain identical text content. The ranges cannot
|
16
|
+
# identical length and contain identical text content. The ranges cannot
|
17
|
+
# overlap.
|
17
18
|
#
|
18
19
|
# @return [Range[]]
|
19
20
|
def ranges
|
@@ -21,9 +22,9 @@ module LanguageServer
|
|
21
22
|
end
|
22
23
|
|
23
24
|
#
|
24
|
-
# An optional word pattern (regular expression) that describes valid
|
25
|
-
# the given ranges. If no pattern is provided, the client
|
26
|
-
# pattern will be used.
|
25
|
+
# An optional word pattern (regular expression) that describes valid
|
26
|
+
# contents for the given ranges. If no pattern is provided, the client
|
27
|
+
# configuration's word pattern will be used.
|
27
28
|
#
|
28
29
|
# @return [string]
|
29
30
|
def word_pattern
|
@@ -45,7 +45,7 @@ module LanguageServer
|
|
45
45
|
|
46
46
|
#
|
47
47
|
# The range that should be selected and revealed when this link is being
|
48
|
-
# followed, e.g the name of a function. Must be contained by the
|
48
|
+
# followed, e.g the name of a function. Must be contained by the
|
49
49
|
# `targetRange`. See also `DocumentSymbol#range`
|
50
50
|
#
|
51
51
|
# @return [Range]
|
@@ -0,0 +1,69 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A notebook cell.
|
6
|
+
#
|
7
|
+
# A cell's document URI must be unique across ALL notebook
|
8
|
+
# cells and can therefore be used to uniquely identify a
|
9
|
+
# notebook cell or the cell's text document.
|
10
|
+
#
|
11
|
+
class NotebookCell
|
12
|
+
def initialize(kind:, document:, metadata: nil, execution_summary: nil)
|
13
|
+
@attributes = {}
|
14
|
+
|
15
|
+
@attributes[:kind] = kind
|
16
|
+
@attributes[:document] = document
|
17
|
+
@attributes[:metadata] = metadata if metadata
|
18
|
+
@attributes[:executionSummary] = execution_summary if execution_summary
|
19
|
+
|
20
|
+
@attributes.freeze
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# The cell's kind
|
25
|
+
#
|
26
|
+
# @return [any]
|
27
|
+
def kind
|
28
|
+
attributes.fetch(:kind)
|
29
|
+
end
|
30
|
+
|
31
|
+
#
|
32
|
+
# The URI of the cell's text document
|
33
|
+
# content.
|
34
|
+
#
|
35
|
+
# @return [string]
|
36
|
+
def document
|
37
|
+
attributes.fetch(:document)
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Additional metadata stored with the cell.
|
42
|
+
#
|
43
|
+
# @return [LSPObject]
|
44
|
+
def metadata
|
45
|
+
attributes.fetch(:metadata)
|
46
|
+
end
|
47
|
+
|
48
|
+
#
|
49
|
+
# Additional execution summary information
|
50
|
+
# if supported by the client.
|
51
|
+
#
|
52
|
+
# @return [ExecutionSummary]
|
53
|
+
def execution_summary
|
54
|
+
attributes.fetch(:executionSummary)
|
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,55 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A change describing how to move a `NotebookCell`
|
6
|
+
# array from state S to S'.
|
7
|
+
#
|
8
|
+
class NotebookCellArrayChange
|
9
|
+
def initialize(start:, delete_count:, cells: nil)
|
10
|
+
@attributes = {}
|
11
|
+
|
12
|
+
@attributes[:start] = start
|
13
|
+
@attributes[:deleteCount] = delete_count
|
14
|
+
@attributes[:cells] = cells if cells
|
15
|
+
|
16
|
+
@attributes.freeze
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# The start offset of the cell that changed.
|
21
|
+
#
|
22
|
+
# @return [number]
|
23
|
+
def start
|
24
|
+
attributes.fetch(:start)
|
25
|
+
end
|
26
|
+
|
27
|
+
#
|
28
|
+
# The deleted cells
|
29
|
+
#
|
30
|
+
# @return [number]
|
31
|
+
def delete_count
|
32
|
+
attributes.fetch(:deleteCount)
|
33
|
+
end
|
34
|
+
|
35
|
+
#
|
36
|
+
# The new cells, if any
|
37
|
+
#
|
38
|
+
# @return [NotebookCell[]]
|
39
|
+
def cells
|
40
|
+
attributes.fetch(:cells)
|
41
|
+
end
|
42
|
+
|
43
|
+
attr_reader :attributes
|
44
|
+
|
45
|
+
def to_hash
|
46
|
+
attributes
|
47
|
+
end
|
48
|
+
|
49
|
+
def to_json(*args)
|
50
|
+
to_hash.to_json(*args)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A notebook cell text document filter denotes a cell text
|
6
|
+
# document by different properties.
|
7
|
+
#
|
8
|
+
class NotebookCellTextDocumentFilter
|
9
|
+
def initialize(notebook:, language: nil)
|
10
|
+
@attributes = {}
|
11
|
+
|
12
|
+
@attributes[:notebook] = notebook
|
13
|
+
@attributes[:language] = language if language
|
14
|
+
|
15
|
+
@attributes.freeze
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
# A filter that matches against the notebook
|
20
|
+
# containing the notebook cell. If a string
|
21
|
+
# value is provided it matches against the
|
22
|
+
# notebook type. '*' matches every notebook.
|
23
|
+
#
|
24
|
+
# @return [string | NotebookDocumentFilter]
|
25
|
+
def notebook
|
26
|
+
attributes.fetch(:notebook)
|
27
|
+
end
|
28
|
+
|
29
|
+
#
|
30
|
+
# A language id like `python`.
|
31
|
+
#
|
32
|
+
# Will be matched against the language id of the
|
33
|
+
# notebook cell document. '*' matches every language.
|
34
|
+
#
|
35
|
+
# @return [string]
|
36
|
+
def language
|
37
|
+
attributes.fetch(:language)
|
38
|
+
end
|
39
|
+
|
40
|
+
attr_reader :attributes
|
41
|
+
|
42
|
+
def to_hash
|
43
|
+
attributes
|
44
|
+
end
|
45
|
+
|
46
|
+
def to_json(*args)
|
47
|
+
to_hash.to_json(*args)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A notebook document.
|
6
|
+
#
|
7
|
+
class NotebookDocument
|
8
|
+
def initialize(uri:, notebook_type:, version:, metadata: nil, cells:)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:uri] = uri
|
12
|
+
@attributes[:notebookType] = notebook_type
|
13
|
+
@attributes[:version] = version
|
14
|
+
@attributes[:metadata] = metadata if metadata
|
15
|
+
@attributes[:cells] = cells
|
16
|
+
|
17
|
+
@attributes.freeze
|
18
|
+
end
|
19
|
+
|
20
|
+
#
|
21
|
+
# The notebook document's URI.
|
22
|
+
#
|
23
|
+
# @return [string]
|
24
|
+
def uri
|
25
|
+
attributes.fetch(:uri)
|
26
|
+
end
|
27
|
+
|
28
|
+
#
|
29
|
+
# The type of the notebook.
|
30
|
+
#
|
31
|
+
# @return [string]
|
32
|
+
def notebook_type
|
33
|
+
attributes.fetch(:notebookType)
|
34
|
+
end
|
35
|
+
|
36
|
+
#
|
37
|
+
# The version number of this document (it will increase after each
|
38
|
+
# change, including undo/redo).
|
39
|
+
#
|
40
|
+
# @return [number]
|
41
|
+
def version
|
42
|
+
attributes.fetch(:version)
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# Additional metadata stored with the notebook
|
47
|
+
# document.
|
48
|
+
#
|
49
|
+
# @return [LSPObject]
|
50
|
+
def metadata
|
51
|
+
attributes.fetch(:metadata)
|
52
|
+
end
|
53
|
+
|
54
|
+
#
|
55
|
+
# The cells of a notebook.
|
56
|
+
#
|
57
|
+
# @return [NotebookCell[]]
|
58
|
+
def cells
|
59
|
+
attributes.fetch(:cells)
|
60
|
+
end
|
61
|
+
|
62
|
+
attr_reader :attributes
|
63
|
+
|
64
|
+
def to_hash
|
65
|
+
attributes
|
66
|
+
end
|
67
|
+
|
68
|
+
def to_json(*args)
|
69
|
+
to_hash.to_json(*args)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A change event for a notebook document.
|
6
|
+
#
|
7
|
+
class NotebookDocumentChangeEvent
|
8
|
+
def initialize(metadata: nil, cells: nil)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:metadata] = metadata if metadata
|
12
|
+
@attributes[:cells] = cells if cells
|
13
|
+
|
14
|
+
@attributes.freeze
|
15
|
+
end
|
16
|
+
|
17
|
+
#
|
18
|
+
# The changed meta data if any.
|
19
|
+
#
|
20
|
+
# @return [LSPObject]
|
21
|
+
def metadata
|
22
|
+
attributes.fetch(:metadata)
|
23
|
+
end
|
24
|
+
|
25
|
+
#
|
26
|
+
# Changes to cells
|
27
|
+
#
|
28
|
+
# @return [{ structure?: { array: NotebookCellArrayChange; didOpen?: TextDocumentItem[]; didClose?: TextDocumentIdentifier[]; }; data?: NotebookCell[]; textContent?: { ...; }[]; }]
|
29
|
+
def cells
|
30
|
+
attributes.fetch(:cells)
|
31
|
+
end
|
32
|
+
|
33
|
+
attr_reader :attributes
|
34
|
+
|
35
|
+
def to_hash
|
36
|
+
attributes
|
37
|
+
end
|
38
|
+
|
39
|
+
def to_json(*args)
|
40
|
+
to_hash.to_json(*args)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# Capabilities specific to the notebook document support.
|
6
|
+
#
|
7
|
+
class NotebookDocumentClientCapabilities
|
8
|
+
def initialize(synchronization:)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:synchronization] = synchronization
|
12
|
+
|
13
|
+
@attributes.freeze
|
14
|
+
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# Capabilities specific to notebook document synchronization
|
18
|
+
#
|
19
|
+
# @return [NotebookDocumentSyncClientCapabilities]
|
20
|
+
def synchronization
|
21
|
+
attributes.fetch(:synchronization)
|
22
|
+
end
|
23
|
+
|
24
|
+
attr_reader :attributes
|
25
|
+
|
26
|
+
def to_hash
|
27
|
+
attributes
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_json(*args)
|
31
|
+
to_hash.to_json(*args)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A notebook document filter denotes a notebook document by
|
6
|
+
# different properties.
|
7
|
+
#
|
8
|
+
class NotebookDocumentFilter
|
9
|
+
def initialize(notebook_type: nil, scheme: nil, pattern: nil)
|
10
|
+
@attributes = {}
|
11
|
+
|
12
|
+
@attributes[:notebookType] = notebook_type if notebook_type
|
13
|
+
@attributes[:scheme] = scheme if scheme
|
14
|
+
@attributes[:pattern] = pattern if pattern
|
15
|
+
|
16
|
+
@attributes.freeze
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# The type of the enclosing notebook.
|
21
|
+
#
|
22
|
+
# --- OR ---
|
23
|
+
#
|
24
|
+
# The type of the enclosing notebook.
|
25
|
+
#
|
26
|
+
# --- OR ---
|
27
|
+
#
|
28
|
+
# The type of the enclosing notebook.
|
29
|
+
#
|
30
|
+
# @return [string]
|
31
|
+
def notebook_type
|
32
|
+
attributes.fetch(:notebookType)
|
33
|
+
end
|
34
|
+
|
35
|
+
#
|
36
|
+
# A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
|
37
|
+
#
|
38
|
+
# --- OR ---
|
39
|
+
#
|
40
|
+
# A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
|
41
|
+
#
|
42
|
+
# --- OR ---
|
43
|
+
#
|
44
|
+
# A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
|
45
|
+
#
|
46
|
+
# @return [string]
|
47
|
+
def scheme
|
48
|
+
attributes.fetch(:scheme)
|
49
|
+
end
|
50
|
+
|
51
|
+
#
|
52
|
+
# A glob pattern.
|
53
|
+
#
|
54
|
+
# --- OR ---
|
55
|
+
#
|
56
|
+
# A glob pattern.
|
57
|
+
#
|
58
|
+
# --- OR ---
|
59
|
+
#
|
60
|
+
# A glob pattern.
|
61
|
+
#
|
62
|
+
# @return [string]
|
63
|
+
def pattern
|
64
|
+
attributes.fetch(:pattern)
|
65
|
+
end
|
66
|
+
|
67
|
+
attr_reader :attributes
|
68
|
+
|
69
|
+
def to_hash
|
70
|
+
attributes
|
71
|
+
end
|
72
|
+
|
73
|
+
def to_json(*args)
|
74
|
+
to_hash.to_json(*args)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module LanguageServer
|
2
|
+
module Protocol
|
3
|
+
module Interface
|
4
|
+
#
|
5
|
+
# A literal to identify a notebook document in the client.
|
6
|
+
#
|
7
|
+
class NotebookDocumentIdentifier
|
8
|
+
def initialize(uri:)
|
9
|
+
@attributes = {}
|
10
|
+
|
11
|
+
@attributes[:uri] = uri
|
12
|
+
|
13
|
+
@attributes.freeze
|
14
|
+
end
|
15
|
+
|
16
|
+
#
|
17
|
+
# The notebook document's URI.
|
18
|
+
#
|
19
|
+
# @return [string]
|
20
|
+
def uri
|
21
|
+
attributes.fetch(:uri)
|
22
|
+
end
|
23
|
+
|
24
|
+
attr_reader :attributes
|
25
|
+
|
26
|
+
def to_hash
|
27
|
+
attributes
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_json(*args)
|
31
|
+
to_hash.to_json(*args)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|