language_server-protocol 3.14.0.0 → 3.15.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -1
  3. data/lib/language_server/protocol/constant.rb +8 -0
  4. data/lib/language_server/protocol/constant/code_action_kind.rb +12 -8
  5. data/lib/language_server/protocol/constant/completion_item_tag.rb +16 -0
  6. data/lib/language_server/protocol/constant/diagnostic_tag.rb +24 -0
  7. data/lib/language_server/protocol/constant/signature_help_trigger_kind.rb +23 -0
  8. data/lib/language_server/protocol/constant/text_document_sync_kind.rb +1 -0
  9. data/lib/language_server/protocol/interface.rb +158 -6
  10. data/lib/language_server/protocol/interface/apply_workspace_edit_response.rb +13 -1
  11. data/lib/language_server/protocol/interface/client_capabilities.rb +11 -2
  12. data/lib/language_server/protocol/interface/code_action.rb +14 -1
  13. data/lib/language_server/protocol/interface/code_action_client_capabilities.rb +52 -0
  14. data/lib/language_server/protocol/interface/code_action_context.rb +5 -1
  15. data/lib/language_server/protocol/interface/code_action_options.rb +3 -5
  16. data/lib/language_server/protocol/interface/code_action_params.rb +3 -2
  17. data/lib/language_server/protocol/interface/code_action_registration_options.rb +3 -1
  18. data/lib/language_server/protocol/interface/code_lens_client_capabilities.rb +33 -0
  19. data/lib/language_server/protocol/interface/code_lens_options.rb +3 -5
  20. data/lib/language_server/protocol/interface/code_lens_params.rb +3 -2
  21. data/lib/language_server/protocol/interface/code_lens_registration_options.rb +3 -10
  22. data/lib/language_server/protocol/interface/color_presentation_params.rb +3 -2
  23. data/lib/language_server/protocol/interface/completion_client_capabilities.rb +59 -0
  24. data/lib/language_server/protocol/interface/completion_item.rb +16 -5
  25. data/lib/language_server/protocol/interface/completion_options.rb +33 -11
  26. data/lib/language_server/protocol/interface/completion_params.rb +3 -2
  27. data/lib/language_server/protocol/interface/completion_registration_options.rb +4 -26
  28. data/lib/language_server/protocol/interface/declaration_client_capabilities.rb +44 -0
  29. data/lib/language_server/protocol/interface/declaration_options.rb +25 -0
  30. data/lib/language_server/protocol/interface/declaration_params.rb +25 -0
  31. data/lib/language_server/protocol/interface/{folding_range_provider_options.rb → declaration_registration_options.rb} +3 -5
  32. data/lib/language_server/protocol/interface/definition_client_capabilities.rb +42 -0
  33. data/lib/language_server/protocol/interface/definition_options.rb +25 -0
  34. data/lib/language_server/protocol/interface/definition_params.rb +25 -0
  35. data/lib/language_server/protocol/interface/definition_registration_options.rb +25 -0
  36. data/lib/language_server/protocol/interface/diagnostic.rb +11 -2
  37. data/lib/language_server/protocol/interface/diagnostic_related_information.rb +1 -1
  38. data/lib/language_server/protocol/interface/did_change_configuration_client_capabilities.rb +33 -0
  39. data/lib/language_server/protocol/interface/did_change_text_document_params.rb +10 -2
  40. data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +35 -0
  41. data/lib/language_server/protocol/interface/did_change_watched_files_registration_options.rb +1 -1
  42. data/lib/language_server/protocol/interface/document_color_client_capabilities.rb +33 -0
  43. data/lib/language_server/protocol/interface/document_color_options.rb +25 -0
  44. data/lib/language_server/protocol/interface/document_color_params.rb +34 -0
  45. data/lib/language_server/protocol/interface/document_color_registration_options.rb +25 -0
  46. data/lib/language_server/protocol/interface/document_formatting_client_capabilities.rb +33 -0
  47. data/lib/language_server/protocol/interface/document_formatting_options.rb +25 -0
  48. data/lib/language_server/protocol/interface/document_formatting_params.rb +3 -2
  49. data/lib/language_server/protocol/interface/document_formatting_registration_options.rb +25 -0
  50. data/lib/language_server/protocol/interface/document_highlight_client_capabilities.rb +33 -0
  51. data/lib/language_server/protocol/interface/document_highlight_options.rb +25 -0
  52. data/lib/language_server/protocol/interface/document_highlight_params.rb +25 -0
  53. data/lib/language_server/protocol/interface/document_highlight_registration_options.rb +25 -0
  54. data/lib/language_server/protocol/interface/document_link.rb +14 -1
  55. data/lib/language_server/protocol/interface/document_link_client_capabilities.rb +42 -0
  56. data/lib/language_server/protocol/interface/document_link_options.rb +3 -5
  57. data/lib/language_server/protocol/interface/document_link_params.rb +3 -2
  58. data/lib/language_server/protocol/interface/document_link_registration_options.rb +3 -10
  59. data/lib/language_server/protocol/interface/document_on_type_formatting_client_capabilities.rb +33 -0
  60. data/lib/language_server/protocol/interface/document_on_type_formatting_options.rb +0 -3
  61. data/lib/language_server/protocol/interface/document_on_type_formatting_params.rb +1 -17
  62. data/lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb +2 -18
  63. data/lib/language_server/protocol/interface/document_range_formatting_client_capabilities.rb +33 -0
  64. data/lib/language_server/protocol/interface/document_range_formatting_options.rb +25 -0
  65. data/lib/language_server/protocol/interface/document_range_formatting_params.rb +3 -2
  66. data/lib/language_server/protocol/interface/document_range_formatting_registration_options.rb +25 -0
  67. data/lib/language_server/protocol/interface/document_symbol.rb +96 -0
  68. data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +51 -0
  69. data/lib/language_server/protocol/interface/document_symbol_options.rb +25 -0
  70. data/lib/language_server/protocol/interface/document_symbol_params.rb +3 -2
  71. data/lib/language_server/protocol/interface/document_symbol_registration_options.rb +25 -0
  72. data/lib/language_server/protocol/interface/execute_command_client_capabilities.rb +33 -0
  73. data/lib/language_server/protocol/interface/execute_command_options.rb +3 -5
  74. data/lib/language_server/protocol/interface/execute_command_params.rb +3 -2
  75. data/lib/language_server/protocol/interface/execute_command_registration_options.rb +3 -10
  76. data/lib/language_server/protocol/interface/folding_range.rb +1 -1
  77. data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +55 -0
  78. data/lib/language_server/protocol/interface/folding_range_options.rb +25 -0
  79. data/lib/language_server/protocol/interface/folding_range_params.rb +3 -2
  80. data/lib/language_server/protocol/interface/{color_provider_options.rb → folding_range_registration_options.rb} +3 -5
  81. data/lib/language_server/protocol/interface/formatting_options.rb +28 -1
  82. data/lib/language_server/protocol/interface/hover_client_capabilities.rb +43 -0
  83. data/lib/language_server/protocol/interface/hover_options.rb +25 -0
  84. data/lib/language_server/protocol/interface/hover_params.rb +25 -0
  85. data/lib/language_server/protocol/interface/hover_registration_options.rb +25 -0
  86. data/lib/language_server/protocol/interface/implementation_client_capabilities.rb +44 -0
  87. data/lib/language_server/protocol/interface/implementation_options.rb +25 -0
  88. data/lib/language_server/protocol/interface/implementation_params.rb +25 -0
  89. data/lib/language_server/protocol/interface/implementation_registration_options.rb +25 -0
  90. data/lib/language_server/protocol/interface/initialize_params.rb +12 -4
  91. data/lib/language_server/protocol/interface/initialize_result.rb +10 -1
  92. data/lib/language_server/protocol/interface/location_link.rb +7 -4
  93. data/lib/language_server/protocol/interface/notification_message.rb +2 -1
  94. data/lib/language_server/protocol/interface/partial_result_params.rb +34 -0
  95. data/lib/language_server/protocol/interface/prepare_rename_params.rb +26 -0
  96. data/lib/language_server/protocol/interface/progress_params.rb +42 -0
  97. data/lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb +53 -0
  98. data/lib/language_server/protocol/interface/publish_diagnostics_params.rb +10 -1
  99. data/lib/language_server/protocol/interface/reference_client_capabilities.rb +33 -0
  100. data/lib/language_server/protocol/interface/reference_options.rb +25 -0
  101. data/lib/language_server/protocol/interface/reference_params.rb +3 -2
  102. data/lib/language_server/protocol/interface/reference_registration_options.rb +25 -0
  103. data/lib/language_server/protocol/interface/rename_client_capabilities.rb +43 -0
  104. data/lib/language_server/protocol/interface/rename_options.rb +3 -5
  105. data/lib/language_server/protocol/interface/rename_params.rb +3 -20
  106. data/lib/language_server/protocol/interface/rename_registration_options.rb +3 -10
  107. data/lib/language_server/protocol/interface/request_message.rb +2 -1
  108. data/lib/language_server/protocol/interface/response_error.rb +2 -2
  109. data/lib/language_server/protocol/interface/response_message.rb +5 -4
  110. data/lib/language_server/protocol/interface/save_options.rb +0 -3
  111. data/lib/language_server/protocol/interface/selection_range.rb +42 -0
  112. data/lib/language_server/protocol/interface/selection_range_client_capabilities.rb +35 -0
  113. data/lib/language_server/protocol/interface/selection_range_options.rb +25 -0
  114. data/lib/language_server/protocol/interface/selection_range_params.rb +43 -0
  115. data/lib/language_server/protocol/interface/selection_range_registration_options.rb +25 -0
  116. data/lib/language_server/protocol/interface/server_capabilities.rb +66 -56
  117. data/lib/language_server/protocol/interface/signature_help.rb +8 -5
  118. data/lib/language_server/protocol/interface/signature_help_client_capabilities.rb +55 -0
  119. data/lib/language_server/protocol/interface/signature_help_context.rb +71 -0
  120. data/lib/language_server/protocol/interface/signature_help_options.rb +15 -5
  121. data/lib/language_server/protocol/interface/signature_help_params.rb +35 -0
  122. data/lib/language_server/protocol/interface/signature_help_registration_options.rb +4 -11
  123. data/lib/language_server/protocol/interface/symbol_information.rb +1 -1
  124. data/lib/language_server/protocol/interface/text_document_change_registration_options.rb +2 -1
  125. data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +87 -87
  126. data/lib/language_server/protocol/interface/text_document_content_change_event.rb +8 -4
  127. data/lib/language_server/protocol/interface/text_document_registration_options.rb +3 -0
  128. data/lib/language_server/protocol/interface/text_document_save_registration_options.rb +1 -0
  129. data/lib/language_server/protocol/interface/text_document_sync_client_capabilities.rb +62 -0
  130. data/lib/language_server/protocol/interface/text_document_sync_options.rb +14 -6
  131. data/lib/language_server/protocol/interface/type_definition_client_capabilities.rb +44 -0
  132. data/lib/language_server/protocol/interface/type_definition_options.rb +25 -0
  133. data/lib/language_server/protocol/interface/type_definition_params.rb +25 -0
  134. data/lib/language_server/protocol/interface/type_definition_registration_options.rb +25 -0
  135. data/lib/language_server/protocol/interface/versioned_text_document_identifier.rb +2 -1
  136. data/lib/language_server/protocol/interface/work_done_progress_begin.rb +80 -0
  137. data/lib/language_server/protocol/interface/work_done_progress_cancel_params.rb +33 -0
  138. data/lib/language_server/protocol/interface/work_done_progress_create_params.rb +33 -0
  139. data/lib/language_server/protocol/interface/work_done_progress_end.rb +40 -0
  140. data/lib/language_server/protocol/interface/work_done_progress_options.rb +30 -0
  141. data/lib/language_server/protocol/interface/work_done_progress_params.rb +33 -0
  142. data/lib/language_server/protocol/interface/work_done_progress_report.rb +70 -0
  143. data/lib/language_server/protocol/interface/workspace_edit.rb +1 -1
  144. data/lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb +53 -0
  145. data/lib/language_server/protocol/interface/workspace_folder.rb +2 -2
  146. data/lib/language_server/protocol/interface/workspace_folders_server_capabilities.rb +48 -0
  147. data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +42 -0
  148. data/lib/language_server/protocol/interface/workspace_symbol_options.rb +25 -0
  149. data/lib/language_server/protocol/interface/workspace_symbol_params.rb +5 -3
  150. data/lib/language_server/protocol/interface/workspace_symbol_registration_options.rb +25 -0
  151. data/lib/language_server/protocol/transport.rb +1 -0
  152. data/lib/language_server/protocol/transport/io.rb +2 -0
  153. data/lib/language_server/protocol/transport/io/reader.rb +47 -0
  154. data/lib/language_server/protocol/transport/io/writer.rb +34 -0
  155. data/lib/language_server/protocol/transport/stdio/reader.rb +3 -29
  156. data/lib/language_server/protocol/transport/stdio/writer.rb +3 -18
  157. data/lib/language_server/protocol/version.rb +1 -1
  158. metadata +92 -31
  159. data/.gitignore +0 -10
  160. data/.travis.yml +0 -5
  161. data/CHANGELOG.md +0 -21
  162. data/CODE_OF_CONDUCT.md +0 -74
  163. data/Dockerfile-node.development +0 -6
  164. data/Dockerfile.development +0 -24
  165. data/Gemfile +0 -6
  166. data/Rakefile +0 -10
  167. data/bin/console +0 -14
  168. data/bin/generate_files +0 -5
  169. data/bin/m +0 -17
  170. data/bin/setup +0 -6
  171. data/circle.yml +0 -46
  172. data/docker-compose.ci.yml +0 -18
  173. data/docker-compose.override.yml +0 -19
  174. data/docker-compose.yml +0 -45
  175. data/language_server-protocol.gemspec +0 -31
  176. data/lib/language_server/protocol/interface/workspace_client_capabilities.rb +0 -104
  177. data/package.json +0 -10
  178. data/scripts/generateFiles.ts +0 -320
  179. data/yarn.lock +0 -293
@@ -1,10 +1,11 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class ReferenceParams < TextDocumentPositionParams
5
- def initialize(text_document:, position:, context:)
4
+ class ReferenceParams < PartialResultParams
5
+ def initialize(partial_result_token: nil, context:)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:partialResultToken] = partial_result_token if partial_result_token
8
9
  @attributes[:context] = context
9
10
 
10
11
  @attributes.freeze
@@ -0,0 +1,25 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class ReferenceRegistrationOptions < ReferenceOptions
5
+ def initialize(work_done_progress: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
9
+
10
+ @attributes.freeze
11
+ end
12
+
13
+ attr_reader :attributes
14
+
15
+ def to_hash
16
+ attributes
17
+ end
18
+
19
+ def to_json(*args)
20
+ to_hash.to_json(*args)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,43 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class RenameClientCapabilities
5
+ def initialize(dynamic_registration: nil, prepare_support: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
9
+ @attributes[:prepareSupport] = prepare_support if prepare_support
10
+
11
+ @attributes.freeze
12
+ end
13
+
14
+ #
15
+ # Whether rename supports dynamic registration.
16
+ #
17
+ # @return [boolean]
18
+ def dynamic_registration
19
+ attributes.fetch(:dynamicRegistration)
20
+ end
21
+
22
+ #
23
+ # Client supports testing for validity of rename operations
24
+ # before execution.
25
+ #
26
+ # @return [boolean]
27
+ def prepare_support
28
+ attributes.fetch(:prepareSupport)
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
@@ -1,13 +1,11 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- #
5
- # Rename options
6
- #
7
- class RenameOptions
8
- def initialize(prepare_provider: nil)
4
+ class RenameOptions < WorkDoneProgressOptions
5
+ def initialize(work_done_progress: nil, prepare_provider: nil)
9
6
  @attributes = {}
10
7
 
8
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
11
9
  @attributes[:prepareProvider] = prepare_provider if prepare_provider
12
10
 
13
11
  @attributes.freeze
@@ -1,33 +1,16 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class RenameParams
5
- def initialize(text_document:, position:, new_name:)
4
+ class RenameParams < WorkDoneProgressParams
5
+ def initialize(work_done_token: nil, new_name:)
6
6
  @attributes = {}
7
7
 
8
- @attributes[:textDocument] = text_document
9
- @attributes[:position] = position
8
+ @attributes[:workDoneToken] = work_done_token if work_done_token
10
9
  @attributes[:newName] = new_name
11
10
 
12
11
  @attributes.freeze
13
12
  end
14
13
 
15
- #
16
- # The document to rename.
17
- #
18
- # @return [TextDocumentIdentifier]
19
- def text_document
20
- attributes.fetch(:textDocument)
21
- end
22
-
23
- #
24
- # The position at which this request was sent.
25
- #
26
- # @return [Position]
27
- def position
28
- attributes.fetch(:position)
29
- end
30
-
31
14
  #
32
15
  # The new name of the symbol. If the given name is not valid the
33
16
  # request must return a [ResponseError](#ResponseError) with an
@@ -1,23 +1,16 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- class RenameRegistrationOptions < TextDocumentRegistrationOptions
5
- def initialize(document_selector:, prepare_provider: nil)
4
+ class RenameRegistrationOptions < RenameOptions
5
+ def initialize(work_done_progress: nil, prepare_provider: nil)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
8
9
  @attributes[:prepareProvider] = prepare_provider if prepare_provider
9
10
 
10
11
  @attributes.freeze
11
12
  end
12
13
 
13
- #
14
- # Renames should be checked and tested for validity before being executed.
15
- #
16
- # @return [boolean]
17
- def prepare_provider
18
- attributes.fetch(:prepareProvider)
19
- end
20
-
21
14
  attr_reader :attributes
22
15
 
23
16
  def to_hash
@@ -5,6 +5,7 @@ module LanguageServer
5
5
  def initialize(jsonrpc:, id:, method:, params: nil)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:jsonrpc] = jsonrpc
8
9
  @attributes[:id] = id
9
10
  @attributes[:method] = method
10
11
  @attributes[:params] = params if params
@@ -31,7 +32,7 @@ module LanguageServer
31
32
  #
32
33
  # The method's params.
33
34
  #
34
- # @return [object | any[]]
35
+ # @return [any]
35
36
  def params
36
37
  attributes.fetch(:params)
37
38
  end
@@ -29,10 +29,10 @@ module LanguageServer
29
29
  end
30
30
 
31
31
  #
32
- # A Primitive or Structured value that contains additional
32
+ # A primitive or structured value that contains additional
33
33
  # information about the error. Can be omitted.
34
34
  #
35
- # @return [D]
35
+ # @return [any]
36
36
  def data
37
37
  attributes.fetch(:data)
38
38
  end
@@ -5,6 +5,7 @@ module LanguageServer
5
5
  def initialize(jsonrpc:, id:, result: nil, error: nil)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:jsonrpc] = jsonrpc
8
9
  @attributes[:id] = id
9
10
  @attributes[:result] = result if result
10
11
  @attributes[:error] = error if error
@@ -21,10 +22,10 @@ module LanguageServer
21
22
  end
22
23
 
23
24
  #
24
- # The result of a request. This can be omitted in
25
- # the case of an error.
25
+ # The result of a request. This member is REQUIRED on success.
26
+ # This member MUST NOT exist if there was an error invoking the method.
26
27
  #
27
- # @return [any]
28
+ # @return [string | number | boolean | object]
28
29
  def result
29
30
  attributes.fetch(:result)
30
31
  end
@@ -32,7 +33,7 @@ module LanguageServer
32
33
  #
33
34
  # The error object in case a request fails.
34
35
  #
35
- # @return [ResponseError<any>]
36
+ # @return [ResponseError]
36
37
  def error
37
38
  attributes.fetch(:error)
38
39
  end
@@ -1,9 +1,6 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
- #
5
- # Save options.
6
- #
7
4
  class SaveOptions
8
5
  def initialize(include_text: nil)
9
6
  @attributes = {}
@@ -0,0 +1,42 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class SelectionRange
5
+ def initialize(range:, parent: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:range] = range
9
+ @attributes[:parent] = parent if parent
10
+
11
+ @attributes.freeze
12
+ end
13
+
14
+ #
15
+ # The [range](#Range) of this selection range.
16
+ #
17
+ # @return [Range]
18
+ def range
19
+ attributes.fetch(:range)
20
+ end
21
+
22
+ #
23
+ # The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
24
+ #
25
+ # @return [SelectionRange]
26
+ def parent
27
+ attributes.fetch(:parent)
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,35 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class SelectionRangeClientCapabilities
5
+ def initialize(dynamic_registration: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
9
+
10
+ @attributes.freeze
11
+ end
12
+
13
+ #
14
+ # Whether implementation supports dynamic registration for selection range providers. If this is set to `true`
15
+ # the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server
16
+ # capability as well.
17
+ #
18
+ # @return [boolean]
19
+ def dynamic_registration
20
+ attributes.fetch(:dynamicRegistration)
21
+ end
22
+
23
+ attr_reader :attributes
24
+
25
+ def to_hash
26
+ attributes
27
+ end
28
+
29
+ def to_json(*args)
30
+ to_hash.to_json(*args)
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class SelectionRangeOptions < WorkDoneProgressOptions
5
+ def initialize(work_done_progress: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:workDoneProgress] = work_done_progress if work_done_progress
9
+
10
+ @attributes.freeze
11
+ end
12
+
13
+ attr_reader :attributes
14
+
15
+ def to_hash
16
+ attributes
17
+ end
18
+
19
+ def to_json(*args)
20
+ to_hash.to_json(*args)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,43 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class SelectionRangeParams < PartialResultParams
5
+ def initialize(partial_result_token: nil, text_document:, positions:)
6
+ @attributes = {}
7
+
8
+ @attributes[:partialResultToken] = partial_result_token if partial_result_token
9
+ @attributes[:textDocument] = text_document
10
+ @attributes[:positions] = positions
11
+
12
+ @attributes.freeze
13
+ end
14
+
15
+ #
16
+ # The text document.
17
+ #
18
+ # @return [TextDocumentIdentifier]
19
+ def text_document
20
+ attributes.fetch(:textDocument)
21
+ end
22
+
23
+ #
24
+ # The positions inside the text document.
25
+ #
26
+ # @return [Position[]]
27
+ def positions
28
+ attributes.fetch(:positions)
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,25 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class SelectionRangeRegistrationOptions < StaticRegistrationOptions
5
+ def initialize(id: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:id] = id if id
9
+
10
+ @attributes.freeze
11
+ end
12
+
13
+ attr_reader :attributes
14
+
15
+ def to_hash
16
+ attributes
17
+ end
18
+
19
+ def to_json(*args)
20
+ to_hash.to_json(*args)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -2,30 +2,32 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class ServerCapabilities
5
- def initialize(text_document_sync: nil, hover_provider: nil, completion_provider: nil, signature_help_provider: nil, definition_provider: nil, type_definition_provider: nil, implementation_provider: nil, references_provider: nil, document_highlight_provider: nil, document_symbol_provider: nil, workspace_symbol_provider: nil, code_action_provider: nil, code_lens_provider: nil, document_formatting_provider: nil, document_range_formatting_provider: nil, document_on_type_formatting_provider: nil, rename_provider: nil, document_link_provider: nil, color_provider: nil, folding_range_provider: nil, execute_command_provider: nil, workspace: nil, experimental: nil)
5
+ def initialize(text_document_sync: nil, completion_provider: nil, hover_provider: nil, signature_help_provider: nil, declaration_provider: nil, definition_provider: nil, type_definition_provider: nil, implementation_provider: nil, references_provider: nil, document_highlight_provider: nil, document_symbol_provider: nil, code_action_provider: nil, code_lens_provider: nil, document_link_provider: nil, color_provider: nil, document_formatting_provider: nil, document_range_formatting_provider: nil, document_on_type_formatting_provider: nil, rename_provider: nil, folding_range_provider: nil, execute_command_provider: nil, selection_range_provider: nil, workspace_symbol_provider: nil, workspace: nil, experimental: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:textDocumentSync] = text_document_sync if text_document_sync
9
- @attributes[:hoverProvider] = hover_provider if hover_provider
10
9
  @attributes[:completionProvider] = completion_provider if completion_provider
10
+ @attributes[:hoverProvider] = hover_provider if hover_provider
11
11
  @attributes[:signatureHelpProvider] = signature_help_provider if signature_help_provider
12
+ @attributes[:declarationProvider] = declaration_provider if declaration_provider
12
13
  @attributes[:definitionProvider] = definition_provider if definition_provider
13
14
  @attributes[:typeDefinitionProvider] = type_definition_provider if type_definition_provider
14
15
  @attributes[:implementationProvider] = implementation_provider if implementation_provider
15
16
  @attributes[:referencesProvider] = references_provider if references_provider
16
17
  @attributes[:documentHighlightProvider] = document_highlight_provider if document_highlight_provider
17
18
  @attributes[:documentSymbolProvider] = document_symbol_provider if document_symbol_provider
18
- @attributes[:workspaceSymbolProvider] = workspace_symbol_provider if workspace_symbol_provider
19
19
  @attributes[:codeActionProvider] = code_action_provider if code_action_provider
20
20
  @attributes[:codeLensProvider] = code_lens_provider if code_lens_provider
21
+ @attributes[:documentLinkProvider] = document_link_provider if document_link_provider
22
+ @attributes[:colorProvider] = color_provider if color_provider
21
23
  @attributes[:documentFormattingProvider] = document_formatting_provider if document_formatting_provider
22
24
  @attributes[:documentRangeFormattingProvider] = document_range_formatting_provider if document_range_formatting_provider
23
25
  @attributes[:documentOnTypeFormattingProvider] = document_on_type_formatting_provider if document_on_type_formatting_provider
24
26
  @attributes[:renameProvider] = rename_provider if rename_provider
25
- @attributes[:documentLinkProvider] = document_link_provider if document_link_provider
26
- @attributes[:colorProvider] = color_provider if color_provider
27
27
  @attributes[:foldingRangeProvider] = folding_range_provider if folding_range_provider
28
28
  @attributes[:executeCommandProvider] = execute_command_provider if execute_command_provider
29
+ @attributes[:selectionRangeProvider] = selection_range_provider if selection_range_provider
30
+ @attributes[:workspaceSymbolProvider] = workspace_symbol_provider if workspace_symbol_provider
29
31
  @attributes[:workspace] = workspace if workspace
30
32
  @attributes[:experimental] = experimental if experimental
31
33
 
@@ -41,14 +43,6 @@ module LanguageServer
41
43
  attributes.fetch(:textDocumentSync)
42
44
  end
43
45
 
44
- #
45
- # The server provides hover support.
46
- #
47
- # @return [boolean]
48
- def hover_provider
49
- attributes.fetch(:hoverProvider)
50
- end
51
-
52
46
  #
53
47
  # The server provides completion support.
54
48
  #
@@ -57,6 +51,14 @@ module LanguageServer
57
51
  attributes.fetch(:completionProvider)
58
52
  end
59
53
 
54
+ #
55
+ # The server provides hover support.
56
+ #
57
+ # @return [boolean | HoverOptions]
58
+ def hover_provider
59
+ attributes.fetch(:hoverProvider)
60
+ end
61
+
60
62
  #
61
63
  # The server provides signature help support.
62
64
  #
@@ -65,30 +67,34 @@ module LanguageServer
65
67
  attributes.fetch(:signatureHelpProvider)
66
68
  end
67
69
 
70
+ #
71
+ # The server provides go to declaration support.
72
+ #
73
+ # @return [boolean | DeclarationOptions | DeclarationRegistrationOptions]
74
+ def declaration_provider
75
+ attributes.fetch(:declarationProvider)
76
+ end
77
+
68
78
  #
69
79
  # The server provides goto definition support.
70
80
  #
71
- # @return [boolean]
81
+ # @return [boolean | DefinitionOptions]
72
82
  def definition_provider
73
83
  attributes.fetch(:definitionProvider)
74
84
  end
75
85
 
76
86
  #
77
- # The server provides Goto Type Definition support.
87
+ # The server provides goto type definition support.
78
88
  #
79
- # Since 3.6.0
80
- #
81
- # @return [boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions)]
89
+ # @return [boolean | TypeDefinitionOptions | TypeDefinitionRegistrationOptions]
82
90
  def type_definition_provider
83
91
  attributes.fetch(:typeDefinitionProvider)
84
92
  end
85
93
 
86
94
  #
87
- # The server provides Goto Implementation support.
88
- #
89
- # Since 3.6.0
95
+ # The server provides goto implementation support.
90
96
  #
91
- # @return [boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions)]
97
+ # @return [boolean | ImplementationOptions | ImplementationRegistrationOptions]
92
98
  def implementation_provider
93
99
  attributes.fetch(:implementationProvider)
94
100
  end
@@ -96,7 +102,7 @@ module LanguageServer
96
102
  #
97
103
  # The server provides find references support.
98
104
  #
99
- # @return [boolean]
105
+ # @return [boolean | ReferenceOptions]
100
106
  def references_provider
101
107
  attributes.fetch(:referencesProvider)
102
108
  end
@@ -104,7 +110,7 @@ module LanguageServer
104
110
  #
105
111
  # The server provides document highlight support.
106
112
  #
107
- # @return [boolean]
113
+ # @return [boolean | DocumentHighlightOptions]
108
114
  def document_highlight_provider
109
115
  attributes.fetch(:documentHighlightProvider)
110
116
  end
@@ -112,19 +118,11 @@ module LanguageServer
112
118
  #
113
119
  # The server provides document symbol support.
114
120
  #
115
- # @return [boolean]
121
+ # @return [boolean | DocumentSymbolOptions]
116
122
  def document_symbol_provider
117
123
  attributes.fetch(:documentSymbolProvider)
118
124
  end
119
125
 
120
- #
121
- # The server provides workspace symbol support.
122
- #
123
- # @return [boolean]
124
- def workspace_symbol_provider
125
- attributes.fetch(:workspaceSymbolProvider)
126
- end
127
-
128
126
  #
129
127
  # The server provides code actions. The `CodeActionOptions` return type is only
130
128
  # valid if the client signals code action literal support via the property
@@ -143,10 +141,26 @@ module LanguageServer
143
141
  attributes.fetch(:codeLensProvider)
144
142
  end
145
143
 
144
+ #
145
+ # The server provides document link support.
146
+ #
147
+ # @return [DocumentLinkOptions]
148
+ def document_link_provider
149
+ attributes.fetch(:documentLinkProvider)
150
+ end
151
+
152
+ #
153
+ # The server provides color provider support.
154
+ #
155
+ # @return [boolean | DocumentColorOptions | DocumentColorRegistrationOptions]
156
+ def color_provider
157
+ attributes.fetch(:colorProvider)
158
+ end
159
+
146
160
  #
147
161
  # The server provides document formatting.
148
162
  #
149
- # @return [boolean]
163
+ # @return [boolean | DocumentFormattingOptions]
150
164
  def document_formatting_provider
151
165
  attributes.fetch(:documentFormattingProvider)
152
166
  end
@@ -154,7 +168,7 @@ module LanguageServer
154
168
  #
155
169
  # The server provides document range formatting.
156
170
  #
157
- # @return [boolean]
171
+ # @return [boolean | DocumentRangeFormattingOptions]
158
172
  def document_range_formatting_provider
159
173
  attributes.fetch(:documentRangeFormattingProvider)
160
174
  end
@@ -178,45 +192,41 @@ module LanguageServer
178
192
  end
179
193
 
180
194
  #
181
- # The server provides document link support.
195
+ # The server provides folding provider support.
182
196
  #
183
- # @return [DocumentLinkOptions]
184
- def document_link_provider
185
- attributes.fetch(:documentLinkProvider)
197
+ # @return [boolean | FoldingRangeOptions | FoldingRangeRegistrationOptions]
198
+ def folding_range_provider
199
+ attributes.fetch(:foldingRangeProvider)
186
200
  end
187
201
 
188
202
  #
189
- # The server provides color provider support.
190
- #
191
- # Since 3.6.0
203
+ # The server provides execute command support.
192
204
  #
193
- # @return [boolean | ColorProviderOptions | (ColorProviderOptions & TextDocumentRegistrationOptions & Static...]
194
- def color_provider
195
- attributes.fetch(:colorProvider)
205
+ # @return [ExecuteCommandOptions]
206
+ def execute_command_provider
207
+ attributes.fetch(:executeCommandProvider)
196
208
  end
197
209
 
198
210
  #
199
- # The server provides folding provider support.
200
- #
201
- # Since 3.10.0
211
+ # The server provides selection range support.
202
212
  #
203
- # @return [boolean | FoldingRangeProviderOptions | (FoldingRangeProviderOptions & TextDocumentRegistrationOp...]
204
- def folding_range_provider
205
- attributes.fetch(:foldingRangeProvider)
213
+ # @return [boolean | SelectionRangeOptions | SelectionRangeRegistrationOptions]
214
+ def selection_range_provider
215
+ attributes.fetch(:selectionRangeProvider)
206
216
  end
207
217
 
208
218
  #
209
- # The server provides execute command support.
219
+ # The server provides workspace symbol support.
210
220
  #
211
- # @return [ExecuteCommandOptions]
212
- def execute_command_provider
213
- attributes.fetch(:executeCommandProvider)
221
+ # @return [boolean]
222
+ def workspace_symbol_provider
223
+ attributes.fetch(:workspaceSymbolProvider)
214
224
  end
215
225
 
216
226
  #
217
227
  # Workspace specific server capabilities
218
228
  #
219
- # @return [{ workspaceFolders?: { supported?: boolean; changeNotifications?: string | boolean; }; }]
229
+ # @return [{ workspaceFolders?: WorkspaceFoldersServerCapabilities; }]
220
230
  def workspace
221
231
  attributes.fetch(:workspace)
222
232
  end