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.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/lib/language_server/protocol/constant/code_action_kind.rb +8 -0
  3. data/lib/language_server/protocol/constant/code_action_trigger_kind.rb +22 -0
  4. data/lib/language_server/protocol/constant/document_diagnostic_report_kind.rb +21 -0
  5. data/lib/language_server/protocol/constant/error_codes.rb +33 -2
  6. data/lib/language_server/protocol/constant/folding_range_kind.rb +24 -0
  7. data/lib/language_server/protocol/constant/{initialize_error.rb → initialize_error_codes.rb} +4 -4
  8. data/lib/language_server/protocol/constant/inlay_hint_kind.rb +19 -0
  9. data/lib/language_server/protocol/constant/moniker_kind.rb +24 -0
  10. data/lib/language_server/protocol/constant/notebook_cell_kind.rb +19 -0
  11. data/lib/language_server/protocol/constant/position_encoding_kind.rb +32 -0
  12. data/lib/language_server/protocol/constant/prepare_support_default_behavior.rb +1 -1
  13. data/lib/language_server/protocol/constant/semantic_token_modifiers.rb +18 -0
  14. data/lib/language_server/protocol/constant/semantic_token_types.rb +35 -0
  15. data/lib/language_server/protocol/constant/uniqueness_level.rb +31 -0
  16. data/lib/language_server/protocol/constant.rb +22 -2
  17. data/lib/language_server/protocol/interface/{apply_workspace_edit_response.rb → apply_workspace_edit_result.rb} +2 -2
  18. data/lib/language_server/protocol/interface/call_hierarchy_item.rb +1 -1
  19. data/lib/language_server/protocol/interface/client_capabilities.rb +13 -4
  20. data/lib/language_server/protocol/interface/code_action.rb +1 -1
  21. data/lib/language_server/protocol/interface/code_action_context.rb +10 -1
  22. data/lib/language_server/protocol/interface/code_lens.rb +1 -1
  23. data/lib/language_server/protocol/interface/color_presentation.rb +1 -1
  24. data/lib/language_server/protocol/interface/command.rb +1 -1
  25. data/lib/language_server/protocol/interface/completion_client_capabilities.rb +23 -3
  26. data/lib/language_server/protocol/interface/completion_item.rb +41 -9
  27. data/lib/language_server/protocol/interface/completion_item_label_details.rb +49 -0
  28. data/lib/language_server/protocol/interface/completion_list.rb +24 -2
  29. data/lib/language_server/protocol/interface/completion_options.rb +11 -1
  30. data/lib/language_server/protocol/interface/completion_registration_options.rb +11 -1
  31. data/lib/language_server/protocol/interface/create_file.rb +1 -1
  32. data/lib/language_server/protocol/interface/delete_file.rb +1 -1
  33. data/lib/language_server/protocol/interface/diagnostic_client_capabilities.rb +49 -0
  34. data/lib/language_server/protocol/interface/diagnostic_options.rb +64 -0
  35. data/lib/language_server/protocol/interface/diagnostic_registration_options.rb +84 -0
  36. data/lib/language_server/protocol/interface/diagnostic_server_cancellation_data.rb +33 -0
  37. data/lib/language_server/protocol/interface/diagnostic_workspace_client_capabilities.rb +42 -0
  38. data/lib/language_server/protocol/interface/did_change_configuration_params.rb +1 -1
  39. data/lib/language_server/protocol/interface/did_change_notebook_document_params.rb +56 -0
  40. data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +11 -1
  41. data/lib/language_server/protocol/interface/did_close_notebook_document_params.rb +46 -0
  42. data/lib/language_server/protocol/interface/did_open_notebook_document_params.rb +46 -0
  43. data/lib/language_server/protocol/interface/did_save_notebook_document_params.rb +36 -0
  44. data/lib/language_server/protocol/interface/document_diagnostic_params.rb +73 -0
  45. data/lib/language_server/protocol/interface/document_diagnostic_report_partial_result.rb +33 -0
  46. data/lib/language_server/protocol/interface/document_link.rb +1 -1
  47. data/lib/language_server/protocol/interface/document_on_type_formatting_options.rb +1 -1
  48. data/lib/language_server/protocol/interface/document_on_type_formatting_params.rb +9 -4
  49. data/lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb +1 -1
  50. data/lib/language_server/protocol/interface/document_symbol.rb +1 -1
  51. data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +1 -1
  52. data/lib/language_server/protocol/interface/execute_command_params.rb +1 -1
  53. data/lib/language_server/protocol/interface/execution_summary.rb +45 -0
  54. data/lib/language_server/protocol/interface/file_system_watcher.rb +3 -14
  55. data/lib/language_server/protocol/interface/folding_range.rb +12 -1
  56. data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +19 -1
  57. data/lib/language_server/protocol/interface/full_document_diagnostic_report.rb +56 -0
  58. data/lib/language_server/protocol/interface/hover_client_capabilities.rb +1 -1
  59. data/lib/language_server/protocol/interface/hover_result.rb +30 -0
  60. data/lib/language_server/protocol/interface/initialize_error.rb +0 -3
  61. data/lib/language_server/protocol/interface/initialize_params.rb +1 -1
  62. data/lib/language_server/protocol/interface/inlay_hint.rb +122 -0
  63. data/lib/language_server/protocol/interface/inlay_hint_client_capabilities.rb +46 -0
  64. data/lib/language_server/protocol/interface/inlay_hint_label_part.rb +79 -0
  65. data/lib/language_server/protocol/interface/inlay_hint_options.rb +43 -0
  66. data/lib/language_server/protocol/interface/inlay_hint_params.rb +54 -0
  67. data/lib/language_server/protocol/interface/inlay_hint_registration_options.rb +63 -0
  68. data/lib/language_server/protocol/interface/inlay_hint_workspace_client_capabilities.rb +42 -0
  69. data/lib/language_server/protocol/interface/inline_value_client_capabilities.rb +37 -0
  70. data/lib/language_server/protocol/interface/inline_value_context.rb +44 -0
  71. data/lib/language_server/protocol/interface/inline_value_evaluatable_expression.rb +52 -0
  72. data/lib/language_server/protocol/interface/inline_value_options.rb +33 -0
  73. data/lib/language_server/protocol/interface/inline_value_params.rb +64 -0
  74. data/lib/language_server/protocol/interface/inline_value_registration_options.rb +53 -0
  75. data/lib/language_server/protocol/interface/inline_value_text.rb +45 -0
  76. data/lib/language_server/protocol/interface/inline_value_variable_lookup.rb +61 -0
  77. data/lib/language_server/protocol/interface/inline_value_workspace_client_capabilities.rb +42 -0
  78. data/lib/language_server/protocol/interface/linked_editing_ranges.rb +5 -4
  79. data/lib/language_server/protocol/interface/location_link.rb +1 -1
  80. data/lib/language_server/protocol/interface/notebook_cell.rb +69 -0
  81. data/lib/language_server/protocol/interface/notebook_cell_array_change.rb +55 -0
  82. data/lib/language_server/protocol/interface/notebook_cell_text_document_filter.rb +52 -0
  83. data/lib/language_server/protocol/interface/notebook_document.rb +74 -0
  84. data/lib/language_server/protocol/interface/notebook_document_change_event.rb +45 -0
  85. data/lib/language_server/protocol/interface/notebook_document_client_capabilities.rb +36 -0
  86. data/lib/language_server/protocol/interface/notebook_document_filter.rb +79 -0
  87. data/lib/language_server/protocol/interface/notebook_document_identifier.rb +36 -0
  88. data/lib/language_server/protocol/interface/notebook_document_sync_client_capabilities.rb +48 -0
  89. data/lib/language_server/protocol/interface/notebook_document_sync_options.rb +56 -0
  90. data/lib/language_server/protocol/interface/notebook_document_sync_registration_options.rb +56 -0
  91. data/lib/language_server/protocol/interface/position.rb +2 -3
  92. data/lib/language_server/protocol/interface/prepare_rename_params.rb +10 -1
  93. data/lib/language_server/protocol/interface/previous_result_id.rb +46 -0
  94. data/lib/language_server/protocol/interface/registration.rb +1 -1
  95. data/lib/language_server/protocol/interface/related_full_document_diagnostic_report.rb +69 -0
  96. data/lib/language_server/protocol/interface/related_unchanged_document_diagnostic_report.rb +62 -0
  97. data/lib/language_server/protocol/interface/relative_pattern.rb +48 -0
  98. data/lib/language_server/protocol/interface/rename_client_capabilities.rb +1 -1
  99. data/lib/language_server/protocol/interface/rename_file.rb +1 -1
  100. data/lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb +29 -1
  101. data/lib/language_server/protocol/interface/server_capabilities.rb +62 -2
  102. data/lib/language_server/protocol/interface/signature_help.rb +2 -2
  103. data/lib/language_server/protocol/interface/symbol_information.rb +1 -1
  104. data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +37 -1
  105. data/lib/language_server/protocol/interface/text_document_content_change_event.rb +2 -2
  106. data/lib/language_server/protocol/interface/text_document_sync_options.rb +2 -0
  107. data/lib/language_server/protocol/interface/type_hierarchy_item.rb +102 -0
  108. data/lib/language_server/protocol/interface/type_hierarchy_options.rb +30 -0
  109. data/lib/language_server/protocol/interface/type_hierarchy_prepare_params.rb +51 -0
  110. data/lib/language_server/protocol/interface/type_hierarchy_registration_options.rb +50 -0
  111. data/lib/language_server/protocol/interface/type_hierarchy_subtypes_params.rb +49 -0
  112. data/lib/language_server/protocol/interface/type_hierarchy_supertypes_params.rb +49 -0
  113. data/lib/language_server/protocol/interface/unchanged_document_diagnostic_report.rb +50 -0
  114. data/lib/language_server/protocol/interface/{markdown_client_capabilities.rb → versioned_notebook_document_identifier.rb} +12 -12
  115. data/lib/language_server/protocol/interface/work_done_progress_report.rb +1 -1
  116. data/lib/language_server/protocol/interface/workspace_diagnostic_params.rb +65 -0
  117. data/lib/language_server/protocol/interface/workspace_diagnostic_report.rb +33 -0
  118. data/lib/language_server/protocol/interface/workspace_diagnostic_report_partial_result.rb +33 -0
  119. data/lib/language_server/protocol/interface/workspace_full_document_diagnostic_report.rb +75 -0
  120. data/lib/language_server/protocol/interface/workspace_symbol.rb +89 -0
  121. data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +14 -3
  122. data/lib/language_server/protocol/interface/workspace_symbol_options.rb +11 -1
  123. data/lib/language_server/protocol/interface/workspace_symbol_registration_options.rb +11 -1
  124. data/lib/language_server/protocol/interface/workspace_unchanged_document_diagnostic_report.rb +68 -0
  125. data/lib/language_server/protocol/interface.rb +124 -4
  126. data/lib/language_server/protocol/transport/io/reader.rb +7 -24
  127. data/lib/language_server/protocol/version.rb +1 -1
  128. metadata +75 -20
@@ -0,0 +1,122 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Inlay hint information.
6
+ #
7
+ class InlayHint
8
+ def initialize(position:, label:, kind: nil, text_edits: nil, tooltip: nil, padding_left: nil, padding_right: nil, data: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:position] = position
12
+ @attributes[:label] = label
13
+ @attributes[:kind] = kind if kind
14
+ @attributes[:textEdits] = text_edits if text_edits
15
+ @attributes[:tooltip] = tooltip if tooltip
16
+ @attributes[:paddingLeft] = padding_left if padding_left
17
+ @attributes[:paddingRight] = padding_right if padding_right
18
+ @attributes[:data] = data if data
19
+
20
+ @attributes.freeze
21
+ end
22
+
23
+ #
24
+ # The position of this hint.
25
+ #
26
+ # @return [Position]
27
+ def position
28
+ attributes.fetch(:position)
29
+ end
30
+
31
+ #
32
+ # The label of this hint. A human readable string or an array of
33
+ # InlayHintLabelPart label parts.
34
+ #
35
+ # *Note* that neither the string nor the label part can be empty.
36
+ #
37
+ # @return [string | InlayHintLabelPart[]]
38
+ def label
39
+ attributes.fetch(:label)
40
+ end
41
+
42
+ #
43
+ # The kind of this hint. Can be omitted in which case the client
44
+ # should fall back to a reasonable default.
45
+ #
46
+ # @return [InlayHintKind]
47
+ def kind
48
+ attributes.fetch(:kind)
49
+ end
50
+
51
+ #
52
+ # Optional text edits that are performed when accepting this inlay hint.
53
+ #
54
+ # *Note* that edits are expected to change the document so that the inlay
55
+ # hint (or its nearest variant) is now part of the document and the inlay
56
+ # hint itself is now obsolete.
57
+ #
58
+ # Depending on the client capability `inlayHint.resolveSupport` clients
59
+ # might resolve this property late using the resolve request.
60
+ #
61
+ # @return [TextEdit[]]
62
+ def text_edits
63
+ attributes.fetch(:textEdits)
64
+ end
65
+
66
+ #
67
+ # The tooltip text when you hover over this item.
68
+ #
69
+ # Depending on the client capability `inlayHint.resolveSupport` clients
70
+ # might resolve this property late using the resolve request.
71
+ #
72
+ # @return [string | MarkupContent]
73
+ def tooltip
74
+ attributes.fetch(:tooltip)
75
+ end
76
+
77
+ #
78
+ # Render padding before the hint.
79
+ #
80
+ # Note: Padding should use the editor's background color, not the
81
+ # background color of the hint itself. That means padding can be used
82
+ # to visually align/separate an inlay hint.
83
+ #
84
+ # @return [boolean]
85
+ def padding_left
86
+ attributes.fetch(:paddingLeft)
87
+ end
88
+
89
+ #
90
+ # Render padding after the hint.
91
+ #
92
+ # Note: Padding should use the editor's background color, not the
93
+ # background color of the hint itself. That means padding can be used
94
+ # to visually align/separate an inlay hint.
95
+ #
96
+ # @return [boolean]
97
+ def padding_right
98
+ attributes.fetch(:paddingRight)
99
+ end
100
+
101
+ #
102
+ # A data entry field that is preserved on a inlay hint between
103
+ # a `textDocument/inlayHint` and a `inlayHint/resolve` request.
104
+ #
105
+ # @return [LSPAny]
106
+ def data
107
+ attributes.fetch(:data)
108
+ end
109
+
110
+ attr_reader :attributes
111
+
112
+ def to_hash
113
+ attributes
114
+ end
115
+
116
+ def to_json(*args)
117
+ to_hash.to_json(*args)
118
+ end
119
+ end
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,46 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Inlay hint client capabilities.
6
+ #
7
+ class InlayHintClientCapabilities
8
+ def initialize(dynamic_registration: nil, resolve_support: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
12
+ @attributes[:resolveSupport] = resolve_support if resolve_support
13
+
14
+ @attributes.freeze
15
+ end
16
+
17
+ #
18
+ # Whether inlay hints support dynamic registration.
19
+ #
20
+ # @return [boolean]
21
+ def dynamic_registration
22
+ attributes.fetch(:dynamicRegistration)
23
+ end
24
+
25
+ #
26
+ # Indicates which properties a client can resolve lazily on a inlay
27
+ # hint.
28
+ #
29
+ # @return [{ properties: string[]; }]
30
+ def resolve_support
31
+ attributes.fetch(:resolveSupport)
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,79 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # An inlay hint label part allows for interactive and composite labels
6
+ # of inlay hints.
7
+ #
8
+ class InlayHintLabelPart
9
+ def initialize(value:, tooltip: nil, location: nil, command: nil)
10
+ @attributes = {}
11
+
12
+ @attributes[:value] = value
13
+ @attributes[:tooltip] = tooltip if tooltip
14
+ @attributes[:location] = location if location
15
+ @attributes[:command] = command if command
16
+
17
+ @attributes.freeze
18
+ end
19
+
20
+ #
21
+ # The value of this label part.
22
+ #
23
+ # @return [string]
24
+ def value
25
+ attributes.fetch(:value)
26
+ end
27
+
28
+ #
29
+ # The tooltip text when you hover over this label part. Depending on
30
+ # the client capability `inlayHint.resolveSupport` clients might resolve
31
+ # this property late using the resolve request.
32
+ #
33
+ # @return [string | MarkupContent]
34
+ def tooltip
35
+ attributes.fetch(:tooltip)
36
+ end
37
+
38
+ #
39
+ # An optional source code location that represents this
40
+ # label part.
41
+ #
42
+ # The editor will use this location for the hover and for code navigation
43
+ # features: This part will become a clickable link that resolves to the
44
+ # definition of the symbol at the given location (not necessarily the
45
+ # location itself), it shows the hover that shows at the given location,
46
+ # and it shows a context menu with further code navigation commands.
47
+ #
48
+ # Depending on the client capability `inlayHint.resolveSupport` clients
49
+ # might resolve this property late using the resolve request.
50
+ #
51
+ # @return [Location]
52
+ def location
53
+ attributes.fetch(:location)
54
+ end
55
+
56
+ #
57
+ # An optional command for this label part.
58
+ #
59
+ # Depending on the client capability `inlayHint.resolveSupport` clients
60
+ # might resolve this property late using the resolve request.
61
+ #
62
+ # @return [Command]
63
+ def command
64
+ attributes.fetch(:command)
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,43 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Inlay hint options used during static registration.
6
+ #
7
+ class InlayHintOptions
8
+ def initialize(work_done_progress: nil, resolve_provider: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
12
+ @attributes[:resolveProvider] = resolve_provider if resolve_provider
13
+
14
+ @attributes.freeze
15
+ end
16
+
17
+ # @return [boolean]
18
+ def work_done_progress
19
+ attributes.fetch(:workDoneProgress)
20
+ end
21
+
22
+ #
23
+ # The server provides support to resolve additional
24
+ # information for an inlay hint item.
25
+ #
26
+ # @return [boolean]
27
+ def resolve_provider
28
+ attributes.fetch(:resolveProvider)
29
+ end
30
+
31
+ attr_reader :attributes
32
+
33
+ def to_hash
34
+ attributes
35
+ end
36
+
37
+ def to_json(*args)
38
+ to_hash.to_json(*args)
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,54 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # A parameter literal used in inlay hint requests.
6
+ #
7
+ class InlayHintParams
8
+ def initialize(work_done_token: nil, text_document:, range:)
9
+ @attributes = {}
10
+
11
+ @attributes[:workDoneToken] = work_done_token if work_done_token
12
+ @attributes[:textDocument] = text_document
13
+ @attributes[:range] = range
14
+
15
+ @attributes.freeze
16
+ end
17
+
18
+ #
19
+ # An optional token that a server can use to report work done progress.
20
+ #
21
+ # @return [ProgressToken]
22
+ def work_done_token
23
+ attributes.fetch(:workDoneToken)
24
+ end
25
+
26
+ #
27
+ # The text document.
28
+ #
29
+ # @return [TextDocumentIdentifier]
30
+ def text_document
31
+ attributes.fetch(:textDocument)
32
+ end
33
+
34
+ #
35
+ # The visible document range for which inlay hints should be computed.
36
+ #
37
+ # @return [Range]
38
+ def range
39
+ attributes.fetch(:range)
40
+ end
41
+
42
+ attr_reader :attributes
43
+
44
+ def to_hash
45
+ attributes
46
+ end
47
+
48
+ def to_json(*args)
49
+ to_hash.to_json(*args)
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,63 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Inlay hint options used during static or dynamic registration.
6
+ #
7
+ class InlayHintRegistrationOptions
8
+ def initialize(work_done_progress: nil, resolve_provider: nil, document_selector:, id: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
12
+ @attributes[:resolveProvider] = resolve_provider if resolve_provider
13
+ @attributes[:documentSelector] = document_selector
14
+ @attributes[:id] = id if id
15
+
16
+ @attributes.freeze
17
+ end
18
+
19
+ # @return [boolean]
20
+ def work_done_progress
21
+ attributes.fetch(:workDoneProgress)
22
+ end
23
+
24
+ #
25
+ # The server provides support to resolve additional
26
+ # information for an inlay hint item.
27
+ #
28
+ # @return [boolean]
29
+ def resolve_provider
30
+ attributes.fetch(:resolveProvider)
31
+ end
32
+
33
+ #
34
+ # A document selector to identify the scope of the registration. If set to
35
+ # null the document selector provided on the client side will be used.
36
+ #
37
+ # @return [DocumentSelector]
38
+ def document_selector
39
+ attributes.fetch(:documentSelector)
40
+ end
41
+
42
+ #
43
+ # The id used to register the request. The id can be used to deregister
44
+ # the request again. See also Registration#id.
45
+ #
46
+ # @return [string]
47
+ def id
48
+ attributes.fetch(:id)
49
+ end
50
+
51
+ attr_reader :attributes
52
+
53
+ def to_hash
54
+ attributes
55
+ end
56
+
57
+ def to_json(*args)
58
+ to_hash.to_json(*args)
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,42 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Client workspace capabilities specific to inlay hints.
6
+ #
7
+ class InlayHintWorkspaceClientCapabilities
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
+ # inlay hints currently shown. It should be used with absolute care and
22
+ # is useful for situation where a server for example detects 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
@@ -0,0 +1,37 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Client capabilities specific to inline values.
6
+ #
7
+ class InlineValueClientCapabilities
8
+ def initialize(dynamic_registration: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
12
+
13
+ @attributes.freeze
14
+ end
15
+
16
+ #
17
+ # Whether implementation supports dynamic registration for inline
18
+ # value providers.
19
+ #
20
+ # @return [boolean]
21
+ def dynamic_registration
22
+ attributes.fetch(:dynamicRegistration)
23
+ end
24
+
25
+ attr_reader :attributes
26
+
27
+ def to_hash
28
+ attributes
29
+ end
30
+
31
+ def to_json(*args)
32
+ to_hash.to_json(*args)
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,44 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class InlineValueContext
5
+ def initialize(frame_id:, stopped_location:)
6
+ @attributes = {}
7
+
8
+ @attributes[:frameId] = frame_id
9
+ @attributes[:stoppedLocation] = stopped_location
10
+
11
+ @attributes.freeze
12
+ end
13
+
14
+ #
15
+ # The stack frame (as a DAP Id) where the execution has stopped.
16
+ #
17
+ # @return [number]
18
+ def frame_id
19
+ attributes.fetch(:frameId)
20
+ end
21
+
22
+ #
23
+ # The document range where execution has stopped.
24
+ # Typically the end position of the range denotes the line where the
25
+ # inline values are shown.
26
+ #
27
+ # @return [Range]
28
+ def stopped_location
29
+ attributes.fetch(:stoppedLocation)
30
+ end
31
+
32
+ attr_reader :attributes
33
+
34
+ def to_hash
35
+ attributes
36
+ end
37
+
38
+ def to_json(*args)
39
+ to_hash.to_json(*args)
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,52 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Provide an inline value through an expression evaluation.
6
+ #
7
+ # If only a range is specified, the expression will be extracted from the
8
+ # underlying document.
9
+ #
10
+ # An optional expression can be used to override the extracted expression.
11
+ #
12
+ class InlineValueEvaluatableExpression
13
+ def initialize(range:, expression: nil)
14
+ @attributes = {}
15
+
16
+ @attributes[:range] = range
17
+ @attributes[:expression] = expression if expression
18
+
19
+ @attributes.freeze
20
+ end
21
+
22
+ #
23
+ # The document range for which the inline value applies.
24
+ # The range is used to extract the evaluatable expression from the
25
+ # underlying document.
26
+ #
27
+ # @return [Range]
28
+ def range
29
+ attributes.fetch(:range)
30
+ end
31
+
32
+ #
33
+ # If specified the expression overrides the extracted expression.
34
+ #
35
+ # @return [string]
36
+ def expression
37
+ attributes.fetch(:expression)
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,33 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Inline value options used during static registration.
6
+ #
7
+ class InlineValueOptions
8
+ def initialize(work_done_progress: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
12
+
13
+ @attributes.freeze
14
+ end
15
+
16
+ # @return [boolean]
17
+ def work_done_progress
18
+ attributes.fetch(:workDoneProgress)
19
+ end
20
+
21
+ attr_reader :attributes
22
+
23
+ def to_hash
24
+ attributes
25
+ end
26
+
27
+ def to_json(*args)
28
+ to_hash.to_json(*args)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,64 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # A parameter literal used in inline value requests.
6
+ #
7
+ class InlineValueParams
8
+ def initialize(work_done_token: nil, text_document:, range:, context:)
9
+ @attributes = {}
10
+
11
+ @attributes[:workDoneToken] = work_done_token if work_done_token
12
+ @attributes[:textDocument] = text_document
13
+ @attributes[:range] = range
14
+ @attributes[:context] = context
15
+
16
+ @attributes.freeze
17
+ end
18
+
19
+ #
20
+ # An optional token that a server can use to report work done progress.
21
+ #
22
+ # @return [ProgressToken]
23
+ def work_done_token
24
+ attributes.fetch(:workDoneToken)
25
+ end
26
+
27
+ #
28
+ # The text document.
29
+ #
30
+ # @return [TextDocumentIdentifier]
31
+ def text_document
32
+ attributes.fetch(:textDocument)
33
+ end
34
+
35
+ #
36
+ # The document range for which inline values should be computed.
37
+ #
38
+ # @return [Range]
39
+ def range
40
+ attributes.fetch(:range)
41
+ end
42
+
43
+ #
44
+ # Additional information about the context in which inline values were
45
+ # requested.
46
+ #
47
+ # @return [InlineValueContext]
48
+ def context
49
+ attributes.fetch(:context)
50
+ end
51
+
52
+ attr_reader :attributes
53
+
54
+ def to_hash
55
+ attributes
56
+ end
57
+
58
+ def to_json(*args)
59
+ to_hash.to_json(*args)
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end