language_server-protocol 3.14.0.2 → 3.16.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (240) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/lib/language_server/protocol/constant.rb +18 -0
  4. data/lib/language_server/protocol/constant/code_action_kind.rb +17 -11
  5. data/lib/language_server/protocol/constant/completion_item_tag.rb +16 -0
  6. data/lib/language_server/protocol/constant/completion_trigger_kind.rb +2 -1
  7. data/lib/language_server/protocol/constant/diagnostic_tag.rb +24 -0
  8. data/lib/language_server/protocol/constant/error_codes.rb +26 -3
  9. data/lib/language_server/protocol/constant/failure_handling_kind.rb +6 -5
  10. data/lib/language_server/protocol/constant/file_operation_pattern_kind.rb +20 -0
  11. data/lib/language_server/protocol/constant/initialize_error.rb +2 -1
  12. data/lib/language_server/protocol/constant/insert_text_mode.rb +30 -0
  13. data/lib/language_server/protocol/constant/prepare_support_default_behavior.rb +13 -0
  14. data/lib/language_server/protocol/constant/signature_help_trigger_kind.rb +24 -0
  15. data/lib/language_server/protocol/constant/symbol_tag.rb +15 -0
  16. data/lib/language_server/protocol/constant/text_document_save_reason.rb +2 -2
  17. data/lib/language_server/protocol/constant/text_document_sync_kind.rb +2 -1
  18. data/lib/language_server/protocol/constant/token_format.rb +9 -0
  19. data/lib/language_server/protocol/interface.rb +270 -6
  20. data/lib/language_server/protocol/interface/annotated_text_edit.rb +56 -0
  21. data/lib/language_server/protocol/interface/apply_workspace_edit_response.rb +24 -1
  22. data/lib/language_server/protocol/interface/call_hierarchy_client_capabilities.rb +36 -0
  23. data/lib/language_server/protocol/interface/call_hierarchy_incoming_call.rb +43 -0
  24. data/lib/language_server/protocol/interface/call_hierarchy_incoming_calls_params.rb +49 -0
  25. data/lib/language_server/protocol/interface/call_hierarchy_item.rb +100 -0
  26. data/lib/language_server/protocol/interface/call_hierarchy_options.rb +30 -0
  27. data/lib/language_server/protocol/interface/call_hierarchy_outgoing_call.rb +43 -0
  28. data/lib/language_server/protocol/interface/call_hierarchy_outgoing_calls_params.rb +49 -0
  29. data/lib/language_server/protocol/interface/call_hierarchy_prepare_params.rb +51 -0
  30. data/lib/language_server/protocol/interface/call_hierarchy_registration_options.rb +50 -0
  31. data/lib/language_server/protocol/interface/change_annotation.rb +57 -0
  32. data/lib/language_server/protocol/interface/client_capabilities.rb +20 -2
  33. data/lib/language_server/protocol/interface/code_action.rb +52 -4
  34. data/lib/language_server/protocol/interface/code_action_client_capabilities.rb +95 -0
  35. data/lib/language_server/protocol/interface/code_action_context.rb +8 -3
  36. data/lib/language_server/protocol/interface/code_action_options.rb +19 -6
  37. data/lib/language_server/protocol/interface/code_action_params.rb +20 -1
  38. data/lib/language_server/protocol/interface/code_action_registration_options.rb +39 -2
  39. data/lib/language_server/protocol/interface/code_description.rb +36 -0
  40. data/lib/language_server/protocol/interface/code_lens.rb +5 -3
  41. data/lib/language_server/protocol/interface/code_lens_client_capabilities.rb +33 -0
  42. data/lib/language_server/protocol/interface/code_lens_options.rb +7 -4
  43. data/lib/language_server/protocol/interface/code_lens_params.rb +20 -1
  44. data/lib/language_server/protocol/interface/code_lens_registration_options.rb +17 -2
  45. data/lib/language_server/protocol/interface/code_lens_workspace_client_capabilities.rb +39 -0
  46. data/lib/language_server/protocol/interface/color_presentation.rb +7 -6
  47. data/lib/language_server/protocol/interface/color_presentation_params.rb +20 -1
  48. data/lib/language_server/protocol/interface/completion_client_capabilities.rb +59 -0
  49. data/lib/language_server/protocol/interface/completion_context.rb +5 -3
  50. data/lib/language_server/protocol/interface/completion_item.rb +71 -29
  51. data/lib/language_server/protocol/interface/completion_list.rb +2 -2
  52. data/lib/language_server/protocol/interface/completion_options.rb +39 -9
  53. data/lib/language_server/protocol/interface/completion_params.rb +39 -3
  54. data/lib/language_server/protocol/interface/completion_registration_options.rb +41 -9
  55. data/lib/language_server/protocol/interface/create_file.rb +10 -1
  56. data/lib/language_server/protocol/interface/create_files_params.rb +37 -0
  57. data/lib/language_server/protocol/interface/declaration_client_capabilities.rb +44 -0
  58. data/lib/language_server/protocol/interface/declaration_options.rb +30 -0
  59. data/lib/language_server/protocol/interface/declaration_params.rb +61 -0
  60. data/lib/language_server/protocol/interface/declaration_registration_options.rb +50 -0
  61. data/lib/language_server/protocol/interface/definition_client_capabilities.rb +42 -0
  62. data/lib/language_server/protocol/interface/definition_options.rb +30 -0
  63. data/lib/language_server/protocol/interface/definition_params.rb +61 -0
  64. data/lib/language_server/protocol/interface/definition_registration_options.rb +40 -0
  65. data/lib/language_server/protocol/interface/delete_file.rb +10 -1
  66. data/lib/language_server/protocol/interface/delete_files_params.rb +37 -0
  67. data/lib/language_server/protocol/interface/diagnostic.rb +31 -2
  68. data/lib/language_server/protocol/interface/diagnostic_related_information.rb +3 -3
  69. data/lib/language_server/protocol/interface/did_change_configuration_client_capabilities.rb +33 -0
  70. data/lib/language_server/protocol/interface/did_change_text_document_params.rb +13 -3
  71. data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +35 -0
  72. data/lib/language_server/protocol/interface/did_change_watched_files_registration_options.rb +1 -1
  73. data/lib/language_server/protocol/interface/document_color_client_capabilities.rb +33 -0
  74. data/lib/language_server/protocol/interface/document_color_options.rb +30 -0
  75. data/lib/language_server/protocol/interface/document_color_params.rb +52 -0
  76. data/lib/language_server/protocol/interface/document_color_registration_options.rb +50 -0
  77. data/lib/language_server/protocol/interface/document_filter.rb +7 -3
  78. data/lib/language_server/protocol/interface/document_formatting_client_capabilities.rb +33 -0
  79. data/lib/language_server/protocol/interface/document_formatting_options.rb +30 -0
  80. data/lib/language_server/protocol/interface/document_formatting_params.rb +10 -1
  81. data/lib/language_server/protocol/interface/document_formatting_registration_options.rb +40 -0
  82. data/lib/language_server/protocol/interface/document_highlight.rb +1 -1
  83. data/lib/language_server/protocol/interface/document_highlight_client_capabilities.rb +33 -0
  84. data/lib/language_server/protocol/interface/document_highlight_options.rb +30 -0
  85. data/lib/language_server/protocol/interface/document_highlight_params.rb +61 -0
  86. data/lib/language_server/protocol/interface/document_highlight_registration_options.rb +40 -0
  87. data/lib/language_server/protocol/interface/document_link.rb +17 -3
  88. data/lib/language_server/protocol/interface/document_link_client_capabilities.rb +42 -0
  89. data/lib/language_server/protocol/interface/document_link_options.rb +7 -4
  90. data/lib/language_server/protocol/interface/document_link_params.rb +20 -1
  91. data/lib/language_server/protocol/interface/document_link_registration_options.rb +17 -2
  92. data/lib/language_server/protocol/interface/document_on_type_formatting_client_capabilities.rb +33 -0
  93. data/lib/language_server/protocol/interface/document_on_type_formatting_options.rb +0 -3
  94. data/lib/language_server/protocol/interface/document_on_type_formatting_params.rb +2 -2
  95. data/lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb +10 -1
  96. data/lib/language_server/protocol/interface/document_range_formatting_client_capabilities.rb +33 -0
  97. data/lib/language_server/protocol/interface/document_range_formatting_options.rb +30 -0
  98. data/lib/language_server/protocol/interface/document_range_formatting_params.rb +10 -1
  99. data/lib/language_server/protocol/interface/document_range_formatting_registration_options.rb +40 -0
  100. data/lib/language_server/protocol/interface/document_symbol.rb +108 -0
  101. data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +73 -0
  102. data/lib/language_server/protocol/interface/document_symbol_options.rb +40 -0
  103. data/lib/language_server/protocol/interface/document_symbol_params.rb +20 -1
  104. data/lib/language_server/protocol/interface/document_symbol_registration_options.rb +50 -0
  105. data/lib/language_server/protocol/interface/execute_command_client_capabilities.rb +33 -0
  106. data/lib/language_server/protocol/interface/execute_command_options.rb +7 -4
  107. data/lib/language_server/protocol/interface/execute_command_params.rb +10 -1
  108. data/lib/language_server/protocol/interface/execute_command_registration_options.rb +7 -1
  109. data/lib/language_server/protocol/interface/file_create.rb +36 -0
  110. data/lib/language_server/protocol/interface/file_delete.rb +36 -0
  111. data/lib/language_server/protocol/interface/file_operation_filter.rb +46 -0
  112. data/lib/language_server/protocol/interface/file_operation_pattern.rb +67 -0
  113. data/lib/language_server/protocol/interface/file_operation_pattern_options.rb +36 -0
  114. data/lib/language_server/protocol/interface/file_operation_registration_options.rb +36 -0
  115. data/lib/language_server/protocol/interface/file_rename.rb +45 -0
  116. data/lib/language_server/protocol/interface/file_system_watcher.rb +7 -3
  117. data/lib/language_server/protocol/interface/folding_range.rb +17 -8
  118. data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +58 -0
  119. data/lib/language_server/protocol/interface/folding_range_options.rb +30 -0
  120. data/lib/language_server/protocol/interface/folding_range_params.rb +20 -1
  121. data/lib/language_server/protocol/interface/folding_range_registration_options.rb +50 -0
  122. data/lib/language_server/protocol/interface/formatting_options.rb +28 -1
  123. data/lib/language_server/protocol/interface/hover.rb +1 -1
  124. data/lib/language_server/protocol/interface/hover_client_capabilities.rb +44 -0
  125. data/lib/language_server/protocol/interface/hover_options.rb +30 -0
  126. data/lib/language_server/protocol/interface/hover_params.rb +51 -0
  127. data/lib/language_server/protocol/interface/hover_registration_options.rb +40 -0
  128. data/lib/language_server/protocol/interface/implementation_client_capabilities.rb +44 -0
  129. data/lib/language_server/protocol/interface/implementation_options.rb +30 -0
  130. data/lib/language_server/protocol/interface/implementation_params.rb +61 -0
  131. data/lib/language_server/protocol/interface/implementation_registration_options.rb +50 -0
  132. data/lib/language_server/protocol/interface/initialize_params.rb +38 -7
  133. data/lib/language_server/protocol/interface/initialize_result.rb +10 -1
  134. data/lib/language_server/protocol/interface/insert_replace_edit.rb +54 -0
  135. data/lib/language_server/protocol/interface/linked_editing_range_client_capabilities.rb +36 -0
  136. data/lib/language_server/protocol/interface/linked_editing_range_options.rb +30 -0
  137. data/lib/language_server/protocol/interface/linked_editing_range_params.rb +51 -0
  138. data/lib/language_server/protocol/interface/linked_editing_range_registration_options.rb +50 -0
  139. data/lib/language_server/protocol/interface/linked_editing_ranges.rb +45 -0
  140. data/lib/language_server/protocol/interface/location_link.rb +11 -6
  141. data/lib/language_server/protocol/interface/log_message_params.rb +1 -1
  142. data/lib/language_server/protocol/interface/log_trace_params.rb +43 -0
  143. data/lib/language_server/protocol/interface/markdown_client_capabilities.rb +45 -0
  144. data/lib/language_server/protocol/interface/markup_content.rb +9 -7
  145. data/lib/language_server/protocol/interface/moniker.rb +64 -0
  146. data/lib/language_server/protocol/interface/moniker_client_capabilities.rb +36 -0
  147. data/lib/language_server/protocol/interface/moniker_options.rb +30 -0
  148. data/lib/language_server/protocol/interface/moniker_params.rb +61 -0
  149. data/lib/language_server/protocol/interface/moniker_registration_options.rb +40 -0
  150. data/lib/language_server/protocol/interface/notification_message.rb +7 -2
  151. data/lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb +50 -0
  152. data/lib/language_server/protocol/interface/parameter_information.rb +7 -5
  153. data/lib/language_server/protocol/interface/partial_result_params.rb +34 -0
  154. data/lib/language_server/protocol/interface/position.rb +5 -5
  155. data/lib/language_server/protocol/interface/prepare_rename_params.rb +42 -0
  156. data/lib/language_server/protocol/interface/progress_params.rb +42 -0
  157. data/lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb +73 -0
  158. data/lib/language_server/protocol/interface/publish_diagnostics_params.rb +11 -1
  159. data/lib/language_server/protocol/interface/reference_client_capabilities.rb +33 -0
  160. data/lib/language_server/protocol/interface/reference_options.rb +30 -0
  161. data/lib/language_server/protocol/interface/reference_params.rb +37 -2
  162. data/lib/language_server/protocol/interface/reference_registration_options.rb +40 -0
  163. data/lib/language_server/protocol/interface/regular_expressions_client_capabilities.rb +45 -0
  164. data/lib/language_server/protocol/interface/rename_client_capabilities.rb +69 -0
  165. data/lib/language_server/protocol/interface/rename_file.rb +10 -1
  166. data/lib/language_server/protocol/interface/rename_files_params.rb +38 -0
  167. data/lib/language_server/protocol/interface/rename_options.rb +7 -4
  168. data/lib/language_server/protocol/interface/rename_params.rb +12 -3
  169. data/lib/language_server/protocol/interface/rename_registration_options.rb +18 -3
  170. data/lib/language_server/protocol/interface/request_message.rb +7 -2
  171. data/lib/language_server/protocol/interface/response_error.rb +2 -2
  172. data/lib/language_server/protocol/interface/response_message.rb +10 -5
  173. data/lib/language_server/protocol/interface/save_options.rb +0 -3
  174. data/lib/language_server/protocol/interface/selection_range.rb +43 -0
  175. data/lib/language_server/protocol/interface/selection_range_client_capabilities.rb +36 -0
  176. data/lib/language_server/protocol/interface/selection_range_options.rb +30 -0
  177. data/lib/language_server/protocol/interface/selection_range_params.rb +61 -0
  178. data/lib/language_server/protocol/interface/selection_range_registration_options.rb +50 -0
  179. data/lib/language_server/protocol/interface/semantic_tokens.rb +45 -0
  180. data/lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb +97 -0
  181. data/lib/language_server/protocol/interface/semantic_tokens_delta.rb +40 -0
  182. data/lib/language_server/protocol/interface/semantic_tokens_delta_params.rb +62 -0
  183. data/lib/language_server/protocol/interface/{folding_range_provider_options.rb → semantic_tokens_delta_partial_result.rb} +8 -5
  184. data/lib/language_server/protocol/interface/semantic_tokens_edit.rb +51 -0
  185. data/lib/language_server/protocol/interface/semantic_tokens_legend.rb +42 -0
  186. data/lib/language_server/protocol/interface/semantic_tokens_options.rb +58 -0
  187. data/lib/language_server/protocol/interface/semantic_tokens_params.rb +52 -0
  188. data/lib/language_server/protocol/interface/{color_provider_options.rb → semantic_tokens_partial_result.rb} +8 -5
  189. data/lib/language_server/protocol/interface/semantic_tokens_range_params.rb +61 -0
  190. data/lib/language_server/protocol/interface/semantic_tokens_registration_options.rb +78 -0
  191. data/lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb +39 -0
  192. data/lib/language_server/protocol/interface/server_capabilities.rb +108 -60
  193. data/lib/language_server/protocol/interface/set_trace_params.rb +33 -0
  194. data/lib/language_server/protocol/interface/show_document_client_capabilities.rb +37 -0
  195. data/lib/language_server/protocol/interface/show_document_params.rb +71 -0
  196. data/lib/language_server/protocol/interface/show_document_result.rb +36 -0
  197. data/lib/language_server/protocol/interface/show_message_params.rb +1 -1
  198. data/lib/language_server/protocol/interface/show_message_request_client_capabilities.rb +36 -0
  199. data/lib/language_server/protocol/interface/show_message_request_params.rb +1 -1
  200. data/lib/language_server/protocol/interface/signature_help.rb +7 -4
  201. data/lib/language_server/protocol/interface/signature_help_client_capabilities.rb +55 -0
  202. data/lib/language_server/protocol/interface/signature_help_context.rb +74 -0
  203. data/lib/language_server/protocol/interface/signature_help_options.rb +20 -4
  204. data/lib/language_server/protocol/interface/signature_help_params.rb +62 -0
  205. data/lib/language_server/protocol/interface/signature_help_registration_options.rb +30 -2
  206. data/lib/language_server/protocol/interface/signature_information.rb +12 -1
  207. data/lib/language_server/protocol/interface/symbol_information.rb +11 -2
  208. data/lib/language_server/protocol/interface/text_document_change_registration_options.rb +11 -2
  209. data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +123 -86
  210. data/lib/language_server/protocol/interface/text_document_content_change_event.rb +10 -6
  211. data/lib/language_server/protocol/interface/text_document_edit.rb +2 -2
  212. data/lib/language_server/protocol/interface/text_document_registration_options.rb +6 -3
  213. data/lib/language_server/protocol/interface/text_document_save_registration_options.rb +10 -1
  214. data/lib/language_server/protocol/interface/text_document_sync_client_capabilities.rb +62 -0
  215. data/lib/language_server/protocol/interface/text_document_sync_options.rb +14 -8
  216. data/lib/language_server/protocol/interface/type_definition_client_capabilities.rb +44 -0
  217. data/lib/language_server/protocol/interface/type_definition_options.rb +30 -0
  218. data/lib/language_server/protocol/interface/type_definition_params.rb +61 -0
  219. data/lib/language_server/protocol/interface/type_definition_registration_options.rb +50 -0
  220. data/lib/language_server/protocol/interface/versioned_text_document_identifier.rb +12 -8
  221. data/lib/language_server/protocol/interface/will_save_text_document_params.rb +1 -1
  222. data/lib/language_server/protocol/interface/work_done_progress_begin.rb +80 -0
  223. data/lib/language_server/protocol/interface/work_done_progress_cancel_params.rb +33 -0
  224. data/lib/language_server/protocol/interface/work_done_progress_create_params.rb +33 -0
  225. data/lib/language_server/protocol/interface/work_done_progress_end.rb +40 -0
  226. data/lib/language_server/protocol/interface/work_done_progress_options.rb +30 -0
  227. data/lib/language_server/protocol/interface/work_done_progress_params.rb +33 -0
  228. data/lib/language_server/protocol/interface/work_done_progress_report.rb +70 -0
  229. data/lib/language_server/protocol/interface/workspace_edit.rb +25 -8
  230. data/lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb +75 -0
  231. data/lib/language_server/protocol/interface/workspace_folder.rb +2 -2
  232. data/lib/language_server/protocol/interface/workspace_folders_server_capabilities.rb +48 -0
  233. data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +53 -0
  234. data/lib/language_server/protocol/interface/workspace_symbol_options.rb +30 -0
  235. data/lib/language_server/protocol/interface/workspace_symbol_params.rb +22 -2
  236. data/lib/language_server/protocol/interface/workspace_symbol_registration_options.rb +30 -0
  237. data/lib/language_server/protocol/transport/io/reader.rb +1 -1
  238. data/lib/language_server/protocol/version.rb +1 -1
  239. metadata +154 -15
  240. data/lib/language_server/protocol/interface/workspace_client_capabilities.rb +0 -104
@@ -0,0 +1,36 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # The result of an show document request.
6
+ #
7
+ class ShowDocumentResult
8
+ def initialize(success:)
9
+ @attributes = {}
10
+
11
+ @attributes[:success] = success
12
+
13
+ @attributes.freeze
14
+ end
15
+
16
+ #
17
+ # A boolean indicating if the show was successful.
18
+ #
19
+ # @return [boolean]
20
+ def success
21
+ attributes.fetch(:success)
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
@@ -14,7 +14,7 @@ module LanguageServer
14
14
  #
15
15
  # The message type. See {@link MessageType}.
16
16
  #
17
- # @return [number]
17
+ # @return [MessageType]
18
18
  def type
19
19
  attributes.fetch(:type)
20
20
  end
@@ -0,0 +1,36 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Show message request client capabilities
6
+ #
7
+ class ShowMessageRequestClientCapabilities
8
+ def initialize(message_action_item: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:messageActionItem] = message_action_item if message_action_item
12
+
13
+ @attributes.freeze
14
+ end
15
+
16
+ #
17
+ # Capabilities specific to the `MessageActionItem` type.
18
+ #
19
+ # @return [{ additionalPropertiesSupport?: boolean; }]
20
+ def message_action_item
21
+ attributes.fetch(:messageActionItem)
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
@@ -15,7 +15,7 @@ module LanguageServer
15
15
  #
16
16
  # The message type. See {@link MessageType}
17
17
  #
18
- # @return [number]
18
+ # @return [MessageType]
19
19
  def type
20
20
  attributes.fetch(:type)
21
21
  end
@@ -18,7 +18,8 @@ module LanguageServer
18
18
  end
19
19
 
20
20
  #
21
- # One or more signatures.
21
+ # One or more signatures. If no signatures are available the signature help
22
+ # request should return `null`.
22
23
  #
23
24
  # @return [SignatureInformation[]]
24
25
  def signatures
@@ -28,9 +29,11 @@ module LanguageServer
28
29
  #
29
30
  # The active signature. If omitted or the value lies outside the
30
31
  # range of `signatures` the value defaults to zero or is ignored if
31
- # `signatures.length === 0`. Whenever possible implementors should
32
- # make an active decision about the active signature and shouldn't
33
- # rely on a default value.
32
+ # the `SignatureHelp` has no signatures.
33
+ #
34
+ # Whenever possible implementors should make an active decision about
35
+ # the active signature and shouldn't rely on a default value.
36
+ #
34
37
  # In future version of the protocol this property might become
35
38
  # mandatory to better express this.
36
39
  #
@@ -0,0 +1,55 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class SignatureHelpClientCapabilities
5
+ def initialize(dynamic_registration: nil, signature_information: nil, context_support: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
9
+ @attributes[:signatureInformation] = signature_information if signature_information
10
+ @attributes[:contextSupport] = context_support if context_support
11
+
12
+ @attributes.freeze
13
+ end
14
+
15
+ #
16
+ # Whether signature help supports dynamic registration.
17
+ #
18
+ # @return [boolean]
19
+ def dynamic_registration
20
+ attributes.fetch(:dynamicRegistration)
21
+ end
22
+
23
+ #
24
+ # The client supports the following `SignatureInformation`
25
+ # specific properties.
26
+ #
27
+ # @return [{ documentationFormat?: MarkupKind[]; parameterInformation?: { labelOffsetSupport?: boolean; }; activeParameterSupport?: boolean; }]
28
+ def signature_information
29
+ attributes.fetch(:signatureInformation)
30
+ end
31
+
32
+ #
33
+ # The client supports to send additional context information for a
34
+ # `textDocument/signatureHelp` request. A client that opts into
35
+ # contextSupport will also support the `retriggerCharacters` on
36
+ # `SignatureHelpOptions`.
37
+ #
38
+ # @return [boolean]
39
+ def context_support
40
+ attributes.fetch(:contextSupport)
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,74 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Additional information about the context in which a signature help request
6
+ # was triggered.
7
+ #
8
+ class SignatureHelpContext
9
+ def initialize(trigger_kind:, trigger_character: nil, is_retrigger:, active_signature_help: nil)
10
+ @attributes = {}
11
+
12
+ @attributes[:triggerKind] = trigger_kind
13
+ @attributes[:triggerCharacter] = trigger_character if trigger_character
14
+ @attributes[:isRetrigger] = is_retrigger
15
+ @attributes[:activeSignatureHelp] = active_signature_help if active_signature_help
16
+
17
+ @attributes.freeze
18
+ end
19
+
20
+ #
21
+ # Action that caused signature help to be triggered.
22
+ #
23
+ # @return [SignatureHelpTriggerKind]
24
+ def trigger_kind
25
+ attributes.fetch(:triggerKind)
26
+ end
27
+
28
+ #
29
+ # Character that caused signature help to be triggered.
30
+ #
31
+ # This is undefined when triggerKind !==
32
+ # SignatureHelpTriggerKind.TriggerCharacter
33
+ #
34
+ # @return [string]
35
+ def trigger_character
36
+ attributes.fetch(:triggerCharacter)
37
+ end
38
+
39
+ #
40
+ # `true` if signature help was already showing when it was triggered.
41
+ #
42
+ # Retriggers occur when the signature help is already active and can be
43
+ # caused by actions such as typing a trigger character, a cursor move, or
44
+ # document content changes.
45
+ #
46
+ # @return [boolean]
47
+ def is_retrigger
48
+ attributes.fetch(:isRetrigger)
49
+ end
50
+
51
+ #
52
+ # The currently active `SignatureHelp`.
53
+ #
54
+ # The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field
55
+ # updated based on the user navigating through available signatures.
56
+ #
57
+ # @return [SignatureHelp]
58
+ def active_signature_help
59
+ attributes.fetch(:activeSignatureHelp)
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
@@ -1,18 +1,22 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- #
5
- # Signature help options.
6
- #
7
4
  class SignatureHelpOptions
8
- def initialize(trigger_characters: nil)
5
+ def initialize(work_done_progress: nil, trigger_characters: nil, retrigger_characters: nil)
9
6
  @attributes = {}
10
7
 
8
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
11
9
  @attributes[:triggerCharacters] = trigger_characters if trigger_characters
10
+ @attributes[:retriggerCharacters] = retrigger_characters if retrigger_characters
12
11
 
13
12
  @attributes.freeze
14
13
  end
15
14
 
15
+ # @return [boolean]
16
+ def work_done_progress
17
+ attributes.fetch(:workDoneProgress)
18
+ end
19
+
16
20
  #
17
21
  # The characters that trigger signature help
18
22
  # automatically.
@@ -22,6 +26,18 @@ module LanguageServer
22
26
  attributes.fetch(:triggerCharacters)
23
27
  end
24
28
 
29
+ #
30
+ # List of characters that re-trigger signature help.
31
+ #
32
+ # These trigger characters are only active when signature help is already
33
+ # showing. All trigger characters are also counted as re-trigger
34
+ # characters.
35
+ #
36
+ # @return [string[]]
37
+ def retrigger_characters
38
+ attributes.fetch(:retriggerCharacters)
39
+ end
40
+
25
41
  attr_reader :attributes
26
42
 
27
43
  def to_hash
@@ -0,0 +1,62 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class SignatureHelpParams
5
+ def initialize(text_document:, position:, work_done_token: nil, context: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:textDocument] = text_document
9
+ @attributes[:position] = position
10
+ @attributes[:workDoneToken] = work_done_token if work_done_token
11
+ @attributes[:context] = context if context
12
+
13
+ @attributes.freeze
14
+ end
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
+ # The signature help context. This is only available if the client
42
+ # specifies to send this using the client capability
43
+ # `textDocument.signatureHelp.contextSupport === true`
44
+ #
45
+ # @return [SignatureHelpContext]
46
+ def context
47
+ attributes.fetch(:context)
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
@@ -1,16 +1,32 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class SignatureHelpRegistrationOptions < TextDocumentRegistrationOptions
5
- def initialize(document_selector:, trigger_characters: nil)
4
+ class SignatureHelpRegistrationOptions
5
+ def initialize(document_selector:, work_done_progress: nil, trigger_characters: nil, retrigger_characters: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:documentSelector] = document_selector
9
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
9
10
  @attributes[:triggerCharacters] = trigger_characters if trigger_characters
11
+ @attributes[:retriggerCharacters] = retrigger_characters if retrigger_characters
10
12
 
11
13
  @attributes.freeze
12
14
  end
13
15
 
16
+ #
17
+ # A document selector to identify the scope of the registration. If set to
18
+ # null the document selector provided on the client side will be used.
19
+ #
20
+ # @return [DocumentSelector]
21
+ def document_selector
22
+ attributes.fetch(:documentSelector)
23
+ end
24
+
25
+ # @return [boolean]
26
+ def work_done_progress
27
+ attributes.fetch(:workDoneProgress)
28
+ end
29
+
14
30
  #
15
31
  # The characters that trigger signature help
16
32
  # automatically.
@@ -20,6 +36,18 @@ module LanguageServer
20
36
  attributes.fetch(:triggerCharacters)
21
37
  end
22
38
 
39
+ #
40
+ # List of characters that re-trigger signature help.
41
+ #
42
+ # These trigger characters are only active when signature help is already
43
+ # showing. All trigger characters are also counted as re-trigger
44
+ # characters.
45
+ #
46
+ # @return [string[]]
47
+ def retrigger_characters
48
+ attributes.fetch(:retriggerCharacters)
49
+ end
50
+
23
51
  attr_reader :attributes
24
52
 
25
53
  def to_hash
@@ -7,12 +7,13 @@ module LanguageServer
7
7
  # a set of parameters.
8
8
  #
9
9
  class SignatureInformation
10
- def initialize(label:, documentation: nil, parameters: nil)
10
+ def initialize(label:, documentation: nil, parameters: nil, active_parameter: nil)
11
11
  @attributes = {}
12
12
 
13
13
  @attributes[:label] = label
14
14
  @attributes[:documentation] = documentation if documentation
15
15
  @attributes[:parameters] = parameters if parameters
16
+ @attributes[:activeParameter] = active_parameter if active_parameter
16
17
 
17
18
  @attributes.freeze
18
19
  end
@@ -43,6 +44,16 @@ module LanguageServer
43
44
  attributes.fetch(:parameters)
44
45
  end
45
46
 
47
+ #
48
+ # The index of the active parameter.
49
+ #
50
+ # If provided, this is used in place of `SignatureHelp.activeParameter`.
51
+ #
52
+ # @return [number]
53
+ def active_parameter
54
+ attributes.fetch(:activeParameter)
55
+ end
56
+
46
57
  attr_reader :attributes
47
58
 
48
59
  def to_hash