language_server-protocol 3.15.0.2 → 3.16.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/lib/language_server/protocol/constant/code_action_kind.rb +6 -4
  4. data/lib/language_server/protocol/constant/completion_item_tag.rb +2 -2
  5. data/lib/language_server/protocol/constant/completion_trigger_kind.rb +2 -1
  6. data/lib/language_server/protocol/constant/diagnostic_tag.rb +2 -2
  7. data/lib/language_server/protocol/constant/error_codes.rb +26 -3
  8. data/lib/language_server/protocol/constant/failure_handling_kind.rb +6 -5
  9. data/lib/language_server/protocol/constant/file_operation_pattern_kind.rb +20 -0
  10. data/lib/language_server/protocol/constant/initialize_error.rb +2 -1
  11. data/lib/language_server/protocol/constant/insert_text_mode.rb +30 -0
  12. data/lib/language_server/protocol/constant/prepare_support_default_behavior.rb +13 -0
  13. data/lib/language_server/protocol/constant/signature_help_trigger_kind.rb +2 -1
  14. data/lib/language_server/protocol/constant/symbol_tag.rb +15 -0
  15. data/lib/language_server/protocol/constant/text_document_save_reason.rb +2 -2
  16. data/lib/language_server/protocol/constant/text_document_sync_kind.rb +2 -2
  17. data/lib/language_server/protocol/constant/token_format.rb +9 -0
  18. data/lib/language_server/protocol/constant.rb +10 -0
  19. data/lib/language_server/protocol/interface/annotated_text_edit.rb +56 -0
  20. data/lib/language_server/protocol/interface/apply_workspace_edit_response.rb +15 -4
  21. data/lib/language_server/protocol/interface/call_hierarchy_client_capabilities.rb +36 -0
  22. data/lib/language_server/protocol/interface/call_hierarchy_incoming_call.rb +43 -0
  23. data/lib/language_server/protocol/interface/call_hierarchy_incoming_calls_params.rb +49 -0
  24. data/lib/language_server/protocol/interface/call_hierarchy_item.rb +100 -0
  25. data/lib/language_server/protocol/interface/call_hierarchy_options.rb +30 -0
  26. data/lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb +43 -0
  27. data/lib/language_server/protocol/interface/call_hierarchy_outgoing_calls_params.rb +49 -0
  28. data/lib/language_server/protocol/interface/call_hierarchy_prepare_params.rb +51 -0
  29. data/lib/language_server/protocol/interface/call_hierarchy_registration_options.rb +50 -0
  30. data/lib/language_server/protocol/interface/change_annotation.rb +57 -0
  31. data/lib/language_server/protocol/interface/client_capabilities.rb +12 -3
  32. data/lib/language_server/protocol/interface/code_action.rb +43 -8
  33. data/lib/language_server/protocol/interface/code_action_client_capabilities.rb +44 -1
  34. data/lib/language_server/protocol/interface/code_action_context.rb +7 -6
  35. data/lib/language_server/protocol/interface/code_action_options.rb +19 -4
  36. data/lib/language_server/protocol/interface/code_action_params.rb +20 -2
  37. data/lib/language_server/protocol/interface/code_action_registration_options.rb +38 -2
  38. data/lib/language_server/protocol/interface/code_description.rb +36 -0
  39. data/lib/language_server/protocol/interface/code_lens.rb +5 -3
  40. data/lib/language_server/protocol/interface/code_lens_options.rb +6 -1
  41. data/lib/language_server/protocol/interface/code_lens_params.rb +20 -2
  42. data/lib/language_server/protocol/interface/code_lens_registration_options.rb +25 -2
  43. data/lib/language_server/protocol/interface/code_lens_workspace_client_capabilities.rb +39 -0
  44. data/lib/language_server/protocol/interface/color_presentation.rb +7 -6
  45. data/lib/language_server/protocol/interface/color_presentation_params.rb +20 -2
  46. data/lib/language_server/protocol/interface/completion_client_capabilities.rb +1 -1
  47. data/lib/language_server/protocol/interface/completion_context.rb +5 -3
  48. data/lib/language_server/protocol/interface/completion_item.rb +60 -29
  49. data/lib/language_server/protocol/interface/completion_list.rb +2 -2
  50. data/lib/language_server/protocol/interface/completion_options.rb +21 -13
  51. data/lib/language_server/protocol/interface/completion_params.rb +40 -3
  52. data/lib/language_server/protocol/interface/completion_registration_options.rb +57 -2
  53. data/lib/language_server/protocol/interface/create_file.rb +10 -1
  54. data/lib/language_server/protocol/interface/create_files_params.rb +37 -0
  55. data/lib/language_server/protocol/interface/declaration_client_capabilities.rb +3 -3
  56. data/lib/language_server/protocol/interface/declaration_options.rb +6 -1
  57. data/lib/language_server/protocol/interface/declaration_params.rb +38 -2
  58. data/lib/language_server/protocol/interface/declaration_registration_options.rb +27 -2
  59. data/lib/language_server/protocol/interface/definition_options.rb +6 -1
  60. data/lib/language_server/protocol/interface/definition_params.rb +38 -2
  61. data/lib/language_server/protocol/interface/definition_registration_options.rb +17 -2
  62. data/lib/language_server/protocol/interface/delete_file.rb +10 -1
  63. data/lib/language_server/protocol/interface/delete_files_params.rb +37 -0
  64. data/lib/language_server/protocol/interface/diagnostic.rb +21 -1
  65. data/lib/language_server/protocol/interface/diagnostic_related_information.rb +3 -3
  66. data/lib/language_server/protocol/interface/did_change_text_document_params.rb +11 -9
  67. data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +3 -3
  68. data/lib/language_server/protocol/interface/document_color_options.rb +6 -1
  69. data/lib/language_server/protocol/interface/document_color_params.rb +20 -2
  70. data/lib/language_server/protocol/interface/document_color_registration_options.rb +27 -2
  71. data/lib/language_server/protocol/interface/document_filter.rb +7 -3
  72. data/lib/language_server/protocol/interface/document_formatting_options.rb +6 -1
  73. data/lib/language_server/protocol/interface/document_formatting_params.rb +9 -1
  74. data/lib/language_server/protocol/interface/document_formatting_registration_options.rb +17 -2
  75. data/lib/language_server/protocol/interface/document_highlight.rb +1 -1
  76. data/lib/language_server/protocol/interface/document_highlight_options.rb +6 -1
  77. data/lib/language_server/protocol/interface/document_highlight_params.rb +38 -2
  78. data/lib/language_server/protocol/interface/document_highlight_registration_options.rb +17 -2
  79. data/lib/language_server/protocol/interface/document_link.rb +6 -5
  80. data/lib/language_server/protocol/interface/document_link_options.rb +6 -1
  81. data/lib/language_server/protocol/interface/document_link_params.rb +20 -2
  82. data/lib/language_server/protocol/interface/document_link_registration_options.rb +25 -2
  83. data/lib/language_server/protocol/interface/document_on_type_formatting_params.rb +17 -1
  84. data/lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb +28 -2
  85. data/lib/language_server/protocol/interface/document_range_formatting_options.rb +6 -1
  86. data/lib/language_server/protocol/interface/document_range_formatting_params.rb +9 -1
  87. data/lib/language_server/protocol/interface/document_range_formatting_registration_options.rb +17 -2
  88. data/lib/language_server/protocol/interface/document_symbol.rb +23 -11
  89. data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +24 -2
  90. data/lib/language_server/protocol/interface/document_symbol_options.rb +17 -2
  91. data/lib/language_server/protocol/interface/document_symbol_params.rb +20 -2
  92. data/lib/language_server/protocol/interface/document_symbol_registration_options.rb +27 -2
  93. data/lib/language_server/protocol/interface/execute_command_options.rb +6 -1
  94. data/lib/language_server/protocol/interface/execute_command_params.rb +9 -1
  95. data/lib/language_server/protocol/interface/execute_command_registration_options.rb +14 -1
  96. data/lib/language_server/protocol/interface/file_create.rb +36 -0
  97. data/lib/language_server/protocol/interface/file_delete.rb +36 -0
  98. data/lib/language_server/protocol/interface/file_operation_filter.rb +46 -0
  99. data/lib/language_server/protocol/interface/file_operation_pattern.rb +67 -0
  100. data/lib/language_server/protocol/interface/file_operation_pattern_options.rb +36 -0
  101. data/lib/language_server/protocol/interface/file_operation_registration_options.rb +36 -0
  102. data/lib/language_server/protocol/interface/file_rename.rb +45 -0
  103. data/lib/language_server/protocol/interface/file_system_watcher.rb +7 -3
  104. data/lib/language_server/protocol/interface/folding_range.rb +17 -8
  105. data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +10 -7
  106. data/lib/language_server/protocol/interface/folding_range_options.rb +6 -1
  107. data/lib/language_server/protocol/interface/folding_range_params.rb +20 -2
  108. data/lib/language_server/protocol/interface/folding_range_registration_options.rb +27 -2
  109. data/lib/language_server/protocol/interface/hover.rb +1 -1
  110. data/lib/language_server/protocol/interface/hover_client_capabilities.rb +3 -2
  111. data/lib/language_server/protocol/interface/hover_options.rb +6 -1
  112. data/lib/language_server/protocol/interface/hover_params.rb +28 -2
  113. data/lib/language_server/protocol/interface/hover_registration_options.rb +17 -2
  114. data/lib/language_server/protocol/interface/implementation_client_capabilities.rb +3 -3
  115. data/lib/language_server/protocol/interface/implementation_options.rb +6 -1
  116. data/lib/language_server/protocol/interface/implementation_params.rb +38 -2
  117. data/lib/language_server/protocol/interface/implementation_registration_options.rb +27 -2
  118. data/lib/language_server/protocol/interface/initialize_params.rb +29 -6
  119. data/lib/language_server/protocol/interface/insert_replace_edit.rb +54 -0
  120. data/lib/language_server/protocol/interface/linked_editing_range_client_capabilities.rb +36 -0
  121. data/lib/language_server/protocol/interface/linked_editing_range_options.rb +30 -0
  122. data/lib/language_server/protocol/interface/linked_editing_range_params.rb +51 -0
  123. data/lib/language_server/protocol/interface/linked_editing_range_registration_options.rb +50 -0
  124. data/lib/language_server/protocol/interface/linked_editing_ranges.rb +45 -0
  125. data/lib/language_server/protocol/interface/location_link.rb +9 -7
  126. data/lib/language_server/protocol/interface/log_message_params.rb +1 -1
  127. data/lib/language_server/protocol/interface/log_trace_params.rb +43 -0
  128. data/lib/language_server/protocol/interface/markdown_client_capabilities.rb +45 -0
  129. data/lib/language_server/protocol/interface/markup_content.rb +9 -7
  130. data/lib/language_server/protocol/interface/moniker.rb +64 -0
  131. data/lib/language_server/protocol/interface/moniker_client_capabilities.rb +36 -0
  132. data/lib/language_server/protocol/interface/moniker_options.rb +30 -0
  133. data/lib/language_server/protocol/interface/moniker_params.rb +61 -0
  134. data/lib/language_server/protocol/interface/moniker_registration_options.rb +40 -0
  135. data/lib/language_server/protocol/interface/notification_message.rb +6 -1
  136. data/lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb +50 -0
  137. data/lib/language_server/protocol/interface/parameter_information.rb +7 -5
  138. data/lib/language_server/protocol/interface/partial_result_params.rb +3 -3
  139. data/lib/language_server/protocol/interface/position.rb +5 -5
  140. data/lib/language_server/protocol/interface/prepare_rename_params.rb +17 -1
  141. data/lib/language_server/protocol/interface/progress_params.rb +1 -1
  142. data/lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb +21 -1
  143. data/lib/language_server/protocol/interface/publish_diagnostics_params.rb +2 -1
  144. data/lib/language_server/protocol/interface/reference_options.rb +6 -1
  145. data/lib/language_server/protocol/interface/reference_params.rb +38 -2
  146. data/lib/language_server/protocol/interface/reference_registration_options.rb +17 -2
  147. data/lib/language_server/protocol/interface/regular_expressions_client_capabilities.rb +45 -0
  148. data/lib/language_server/protocol/interface/rename_client_capabilities.rb +27 -1
  149. data/lib/language_server/protocol/interface/rename_file.rb +10 -1
  150. data/lib/language_server/protocol/interface/rename_files_params.rb +38 -0
  151. data/lib/language_server/protocol/interface/rename_options.rb +6 -1
  152. data/lib/language_server/protocol/interface/rename_params.rb +28 -2
  153. data/lib/language_server/protocol/interface/rename_registration_options.rb +25 -2
  154. data/lib/language_server/protocol/interface/request_message.rb +6 -1
  155. data/lib/language_server/protocol/interface/response_message.rb +6 -1
  156. data/lib/language_server/protocol/interface/selection_range.rb +2 -1
  157. data/lib/language_server/protocol/interface/selection_range_client_capabilities.rb +4 -3
  158. data/lib/language_server/protocol/interface/selection_range_options.rb +6 -1
  159. data/lib/language_server/protocol/interface/selection_range_params.rb +20 -2
  160. data/lib/language_server/protocol/interface/selection_range_registration_options.rb +27 -2
  161. data/lib/language_server/protocol/interface/semantic_tokens.rb +45 -0
  162. data/lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb +97 -0
  163. data/lib/language_server/protocol/interface/semantic_tokens_delta.rb +40 -0
  164. data/lib/language_server/protocol/interface/semantic_tokens_delta_params.rb +62 -0
  165. data/lib/language_server/protocol/interface/semantic_tokens_delta_partial_result.rb +30 -0
  166. data/lib/language_server/protocol/interface/semantic_tokens_edit.rb +51 -0
  167. data/lib/language_server/protocol/interface/semantic_tokens_legend.rb +42 -0
  168. data/lib/language_server/protocol/interface/semantic_tokens_options.rb +58 -0
  169. data/lib/language_server/protocol/interface/semantic_tokens_params.rb +52 -0
  170. data/lib/language_server/protocol/interface/semantic_tokens_partial_result.rb +30 -0
  171. data/lib/language_server/protocol/interface/semantic_tokens_range_params.rb +61 -0
  172. data/lib/language_server/protocol/interface/semantic_tokens_registration_options.rb +78 -0
  173. data/lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb +39 -0
  174. data/lib/language_server/protocol/interface/server_capabilities.rb +47 -9
  175. data/lib/language_server/protocol/interface/set_trace_params.rb +33 -0
  176. data/lib/language_server/protocol/interface/show_document_client_capabilities.rb +37 -0
  177. data/lib/language_server/protocol/interface/show_document_params.rb +71 -0
  178. data/lib/language_server/protocol/interface/show_document_result.rb +36 -0
  179. data/lib/language_server/protocol/interface/show_message_params.rb +1 -1
  180. data/lib/language_server/protocol/interface/show_message_request_client_capabilities.rb +36 -0
  181. data/lib/language_server/protocol/interface/show_message_request_params.rb +1 -1
  182. data/lib/language_server/protocol/interface/signature_help.rb +3 -3
  183. data/lib/language_server/protocol/interface/signature_help_client_capabilities.rb +1 -1
  184. data/lib/language_server/protocol/interface/signature_help_context.rb +10 -7
  185. data/lib/language_server/protocol/interface/signature_help_options.rb +9 -3
  186. data/lib/language_server/protocol/interface/signature_help_params.rb +31 -4
  187. data/lib/language_server/protocol/interface/signature_help_registration_options.rb +38 -2
  188. data/lib/language_server/protocol/interface/signature_information.rb +12 -1
  189. data/lib/language_server/protocol/interface/symbol_information.rb +10 -1
  190. data/lib/language_server/protocol/interface/text_document_change_registration_options.rb +11 -2
  191. data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +39 -2
  192. data/lib/language_server/protocol/interface/text_document_content_change_event.rb +2 -2
  193. data/lib/language_server/protocol/interface/text_document_edit.rb +2 -2
  194. data/lib/language_server/protocol/interface/text_document_registration_options.rb +3 -3
  195. data/lib/language_server/protocol/interface/text_document_save_registration_options.rb +10 -1
  196. data/lib/language_server/protocol/interface/text_document_sync_options.rb +13 -15
  197. data/lib/language_server/protocol/interface/type_definition_client_capabilities.rb +3 -3
  198. data/lib/language_server/protocol/interface/type_definition_options.rb +6 -1
  199. data/lib/language_server/protocol/interface/type_definition_params.rb +38 -2
  200. data/lib/language_server/protocol/interface/type_definition_registration_options.rb +27 -2
  201. data/lib/language_server/protocol/interface/versioned_text_document_identifier.rb +12 -8
  202. data/lib/language_server/protocol/interface/will_save_text_document_params.rb +1 -1
  203. data/lib/language_server/protocol/interface/work_done_progress_begin.rb +3 -3
  204. data/lib/language_server/protocol/interface/work_done_progress_cancel_params.rb +1 -1
  205. data/lib/language_server/protocol/interface/work_done_progress_create_params.rb +1 -1
  206. data/lib/language_server/protocol/interface/work_done_progress_params.rb +1 -1
  207. data/lib/language_server/protocol/interface/work_done_progress_report.rb +5 -5
  208. data/lib/language_server/protocol/interface/workspace_edit.rb +24 -7
  209. data/lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb +23 -1
  210. data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +13 -2
  211. data/lib/language_server/protocol/interface/workspace_symbol_options.rb +6 -1
  212. data/lib/language_server/protocol/interface/workspace_symbol_params.rb +20 -2
  213. data/lib/language_server/protocol/interface/workspace_symbol_registration_options.rb +6 -1
  214. data/lib/language_server/protocol/interface.rb +112 -0
  215. data/lib/language_server/protocol/transport/io/reader.rb +8 -24
  216. data/lib/language_server/protocol/transport/io/writer.rb +1 -0
  217. data/lib/language_server/protocol/version.rb +1 -1
  218. metadata +68 -21
@@ -1,19 +1,56 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class CompletionParams < PartialResultParams
5
- def initialize(partial_result_token: nil, context: nil)
4
+ class CompletionParams
5
+ def initialize(text_document:, position:, work_done_token: nil, partial_result_token: nil, context: nil)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:textDocument] = text_document
9
+ @attributes[:position] = position
10
+ @attributes[:workDoneToken] = work_done_token if work_done_token
8
11
  @attributes[:partialResultToken] = partial_result_token if partial_result_token
9
12
  @attributes[:context] = context if context
10
13
 
11
14
  @attributes.freeze
12
15
  end
13
16
 
17
+ #
18
+ # The text document.
19
+ #
20
+ # @return [TextDocumentIdentifier]
21
+ def text_document
22
+ attributes.fetch(:textDocument)
23
+ end
24
+
25
+ #
26
+ # The position inside the text document.
27
+ #
28
+ # @return [Position]
29
+ def position
30
+ attributes.fetch(:position)
31
+ end
32
+
33
+ #
34
+ # An optional token that a server can use to report work done progress.
35
+ #
36
+ # @return [ProgressToken]
37
+ def work_done_token
38
+ attributes.fetch(:workDoneToken)
39
+ end
40
+
41
+ #
42
+ # An optional token that a server can use to report partial results (e.g.
43
+ # streaming) to the client.
44
+ #
45
+ # @return [ProgressToken]
46
+ def partial_result_token
47
+ attributes.fetch(:partialResultToken)
48
+ end
49
+
14
50
  #
15
51
  # The completion context. This is only available if the client specifies
16
- # to send this using `ClientCapabilities.textDocument.completion.contextSupport === true`
52
+ # to send this using the client capability
53
+ # `completion.contextSupport === true`
17
54
  #
18
55
  # @return [CompletionContext]
19
56
  def context
@@ -1,10 +1,11 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class CompletionRegistrationOptions < CompletionOptions
5
- def initialize(work_done_progress: nil, trigger_characters: nil, all_commit_characters: nil, resolve_provider: nil)
4
+ class CompletionRegistrationOptions
5
+ def initialize(document_selector:, work_done_progress: nil, trigger_characters: nil, all_commit_characters: nil, resolve_provider: nil)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:documentSelector] = document_selector
8
9
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
9
10
  @attributes[:triggerCharacters] = trigger_characters if trigger_characters
10
11
  @attributes[:allCommitCharacters] = all_commit_characters if all_commit_characters
@@ -13,6 +14,60 @@ module LanguageServer
13
14
  @attributes.freeze
14
15
  end
15
16
 
17
+ #
18
+ # A document selector to identify the scope of the registration. If set to
19
+ # null the document selector provided on the client side will be used.
20
+ #
21
+ # @return [DocumentSelector]
22
+ def document_selector
23
+ attributes.fetch(:documentSelector)
24
+ end
25
+
26
+ # @return [boolean]
27
+ def work_done_progress
28
+ attributes.fetch(:workDoneProgress)
29
+ end
30
+
31
+ #
32
+ # Most tools trigger completion request automatically without explicitly
33
+ # requesting it using a keyboard shortcut (e.g. Ctrl+Space). Typically they
34
+ # do so when the user starts to type an identifier. For example if the user
35
+ # types `c` in a JavaScript file code complete will automatically pop up
36
+ # present `console` besides others as a completion item. Characters that
37
+ # make up identifiers don't need to be listed here.
38
+ #
39
+ # If code complete should automatically be trigger on characters not being
40
+ # valid inside an identifier (for example `.` in JavaScript) list them in
41
+ # `triggerCharacters`.
42
+ #
43
+ # @return [string[]]
44
+ def trigger_characters
45
+ attributes.fetch(:triggerCharacters)
46
+ end
47
+
48
+ #
49
+ # The list of all possible characters that commit a completion. This field
50
+ # can be used if clients don't support individual commit characters per
51
+ # completion item. See client capability
52
+ # `completion.completionItem.commitCharactersSupport`.
53
+ #
54
+ # If a server provides both `allCommitCharacters` and commit characters on
55
+ # an individual completion item the ones on the completion item win.
56
+ #
57
+ # @return [string[]]
58
+ def all_commit_characters
59
+ attributes.fetch(:allCommitCharacters)
60
+ end
61
+
62
+ #
63
+ # The server provides support to resolve additional
64
+ # information for a completion item.
65
+ #
66
+ # @return [boolean]
67
+ def resolve_provider
68
+ attributes.fetch(:resolveProvider)
69
+ end
70
+
16
71
  attr_reader :attributes
17
72
 
18
73
  def to_hash
@@ -5,12 +5,13 @@ module LanguageServer
5
5
  # Create file operation
6
6
  #
7
7
  class CreateFile
8
- def initialize(kind:, uri:, options: nil)
8
+ def initialize(kind:, uri:, options: nil, annotation_id: nil)
9
9
  @attributes = {}
10
10
 
11
11
  @attributes[:kind] = kind
12
12
  @attributes[:uri] = uri
13
13
  @attributes[:options] = options if options
14
+ @attributes[:annotationId] = annotation_id if annotation_id
14
15
 
15
16
  @attributes.freeze
16
17
  end
@@ -39,6 +40,14 @@ module LanguageServer
39
40
  attributes.fetch(:options)
40
41
  end
41
42
 
43
+ #
44
+ # An optional annotation identifer describing the operation.
45
+ #
46
+ # @return [string]
47
+ def annotation_id
48
+ attributes.fetch(:annotationId)
49
+ end
50
+
42
51
  attr_reader :attributes
43
52
 
44
53
  def to_hash
@@ -0,0 +1,37 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # The parameters sent in notifications/requests for user-initiated creation
6
+ # of files.
7
+ #
8
+ class CreateFilesParams
9
+ def initialize(files:)
10
+ @attributes = {}
11
+
12
+ @attributes[:files] = files
13
+
14
+ @attributes.freeze
15
+ end
16
+
17
+ #
18
+ # An array of all files/folders created in this operation.
19
+ #
20
+ # @return [FileCreate[]]
21
+ def files
22
+ attributes.fetch(:files)
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
@@ -12,9 +12,9 @@ module LanguageServer
12
12
  end
13
13
 
14
14
  #
15
- # Whether declaration supports dynamic registration. If this is set to `true`
16
- # the client supports the new `DeclarationRegistrationOptions` return value
17
- # for the corresponding server capability as well.
15
+ # Whether declaration supports dynamic registration. If this is set to
16
+ # `true` the client supports the new `DeclarationRegistrationOptions`
17
+ # return value for the corresponding server capability as well.
18
18
  #
19
19
  # @return [boolean]
20
20
  def dynamic_registration
@@ -1,7 +1,7 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class DeclarationOptions < WorkDoneProgressOptions
4
+ class DeclarationOptions
5
5
  def initialize(work_done_progress: nil)
6
6
  @attributes = {}
7
7
 
@@ -10,6 +10,11 @@ module LanguageServer
10
10
  @attributes.freeze
11
11
  end
12
12
 
13
+ # @return [boolean]
14
+ def work_done_progress
15
+ attributes.fetch(:workDoneProgress)
16
+ end
17
+
13
18
  attr_reader :attributes
14
19
 
15
20
  def to_hash
@@ -1,15 +1,51 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class DeclarationParams < PartialResultParams
5
- def initialize(partial_result_token: nil)
4
+ class DeclarationParams
5
+ def initialize(text_document:, position:, work_done_token: nil, partial_result_token: nil)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:textDocument] = text_document
9
+ @attributes[:position] = position
10
+ @attributes[:workDoneToken] = work_done_token if work_done_token
8
11
  @attributes[:partialResultToken] = partial_result_token if partial_result_token
9
12
 
10
13
  @attributes.freeze
11
14
  end
12
15
 
16
+ #
17
+ # The text document.
18
+ #
19
+ # @return [TextDocumentIdentifier]
20
+ def text_document
21
+ attributes.fetch(:textDocument)
22
+ end
23
+
24
+ #
25
+ # The position inside the text document.
26
+ #
27
+ # @return [Position]
28
+ def position
29
+ attributes.fetch(:position)
30
+ end
31
+
32
+ #
33
+ # An optional token that a server can use to report work done progress.
34
+ #
35
+ # @return [ProgressToken]
36
+ def work_done_token
37
+ attributes.fetch(:workDoneToken)
38
+ end
39
+
40
+ #
41
+ # An optional token that a server can use to report partial results (e.g.
42
+ # streaming) to the client.
43
+ #
44
+ # @return [ProgressToken]
45
+ def partial_result_token
46
+ attributes.fetch(:partialResultToken)
47
+ end
48
+
13
49
  attr_reader :attributes
14
50
 
15
51
  def to_hash
@@ -1,15 +1,40 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class DeclarationRegistrationOptions < StaticRegistrationOptions
5
- def initialize(id: nil)
4
+ class DeclarationRegistrationOptions
5
+ def initialize(work_done_progress: nil, document_selector:, id: nil)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
9
+ @attributes[:documentSelector] = document_selector
8
10
  @attributes[:id] = id if id
9
11
 
10
12
  @attributes.freeze
11
13
  end
12
14
 
15
+ # @return [boolean]
16
+ def work_done_progress
17
+ attributes.fetch(:workDoneProgress)
18
+ end
19
+
20
+ #
21
+ # A document selector to identify the scope of the registration. If set to
22
+ # null the document selector provided on the client side will be used.
23
+ #
24
+ # @return [DocumentSelector]
25
+ def document_selector
26
+ attributes.fetch(:documentSelector)
27
+ end
28
+
29
+ #
30
+ # The id used to register the request. The id can be used to deregister
31
+ # the request again. See also Registration#id.
32
+ #
33
+ # @return [string]
34
+ def id
35
+ attributes.fetch(:id)
36
+ end
37
+
13
38
  attr_reader :attributes
14
39
 
15
40
  def to_hash
@@ -1,7 +1,7 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class DefinitionOptions < WorkDoneProgressOptions
4
+ class DefinitionOptions
5
5
  def initialize(work_done_progress: nil)
6
6
  @attributes = {}
7
7
 
@@ -10,6 +10,11 @@ module LanguageServer
10
10
  @attributes.freeze
11
11
  end
12
12
 
13
+ # @return [boolean]
14
+ def work_done_progress
15
+ attributes.fetch(:workDoneProgress)
16
+ end
17
+
13
18
  attr_reader :attributes
14
19
 
15
20
  def to_hash
@@ -1,15 +1,51 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class DefinitionParams < PartialResultParams
5
- def initialize(partial_result_token: nil)
4
+ class DefinitionParams
5
+ def initialize(text_document:, position:, work_done_token: nil, partial_result_token: nil)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:textDocument] = text_document
9
+ @attributes[:position] = position
10
+ @attributes[:workDoneToken] = work_done_token if work_done_token
8
11
  @attributes[:partialResultToken] = partial_result_token if partial_result_token
9
12
 
10
13
  @attributes.freeze
11
14
  end
12
15
 
16
+ #
17
+ # The text document.
18
+ #
19
+ # @return [TextDocumentIdentifier]
20
+ def text_document
21
+ attributes.fetch(:textDocument)
22
+ end
23
+
24
+ #
25
+ # The position inside the text document.
26
+ #
27
+ # @return [Position]
28
+ def position
29
+ attributes.fetch(:position)
30
+ end
31
+
32
+ #
33
+ # An optional token that a server can use to report work done progress.
34
+ #
35
+ # @return [ProgressToken]
36
+ def work_done_token
37
+ attributes.fetch(:workDoneToken)
38
+ end
39
+
40
+ #
41
+ # An optional token that a server can use to report partial results (e.g.
42
+ # streaming) to the client.
43
+ #
44
+ # @return [ProgressToken]
45
+ def partial_result_token
46
+ attributes.fetch(:partialResultToken)
47
+ end
48
+
13
49
  attr_reader :attributes
14
50
 
15
51
  def to_hash
@@ -1,15 +1,30 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class DefinitionRegistrationOptions < DefinitionOptions
5
- def initialize(work_done_progress: nil)
4
+ class DefinitionRegistrationOptions
5
+ def initialize(document_selector:, work_done_progress: nil)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:documentSelector] = document_selector
8
9
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
9
10
 
10
11
  @attributes.freeze
11
12
  end
12
13
 
14
+ #
15
+ # A document selector to identify the scope of the registration. If set to
16
+ # null the document selector provided on the client side will be used.
17
+ #
18
+ # @return [DocumentSelector]
19
+ def document_selector
20
+ attributes.fetch(:documentSelector)
21
+ end
22
+
23
+ # @return [boolean]
24
+ def work_done_progress
25
+ attributes.fetch(:workDoneProgress)
26
+ end
27
+
13
28
  attr_reader :attributes
14
29
 
15
30
  def to_hash