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
@@ -19,21 +19,25 @@ module LanguageServer
19
19
  #
20
20
  # The range of the document that changed.
21
21
  #
22
- # @return [Range]
22
+ # @return [Range, nil]
23
23
  def range
24
24
  attributes.fetch(:range)
25
25
  end
26
26
 
27
27
  #
28
- # The length of the range that got replaced.
28
+ # The optional length of the range that got replaced.
29
29
  #
30
- # @return [number]
30
+ # @return [number, nil]
31
31
  def range_length
32
32
  attributes.fetch(:rangeLength)
33
33
  end
34
34
 
35
35
  #
36
- # The new text of the range/document.
36
+ # The new text for the provided range.
37
+ #
38
+ # --- OR ---
39
+ #
40
+ # The new text of the whole document.
37
41
  #
38
42
  # @return [string]
39
43
  def text
@@ -1,6 +1,9 @@
1
1
  module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
+ #
5
+ # General text document registration options.
6
+ #
4
7
  class TextDocumentRegistrationOptions
5
8
  def initialize(document_selector:)
6
9
  @attributes = {}
@@ -5,6 +5,7 @@ module LanguageServer
5
5
  def initialize(document_selector:, include_text: nil)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:documentSelector] = document_selector
8
9
  @attributes[:includeText] = include_text if include_text
9
10
 
10
11
  @attributes.freeze
@@ -0,0 +1,62 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class TextDocumentSyncClientCapabilities
5
+ def initialize(dynamic_registration: nil, will_save: nil, will_save_wait_until: nil, did_save: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
9
+ @attributes[:willSave] = will_save if will_save
10
+ @attributes[:willSaveWaitUntil] = will_save_wait_until if will_save_wait_until
11
+ @attributes[:didSave] = did_save if did_save
12
+
13
+ @attributes.freeze
14
+ end
15
+
16
+ #
17
+ # Whether text document synchronization supports dynamic registration.
18
+ #
19
+ # @return [boolean]
20
+ def dynamic_registration
21
+ attributes.fetch(:dynamicRegistration)
22
+ end
23
+
24
+ #
25
+ # The client supports sending will save notifications.
26
+ #
27
+ # @return [boolean]
28
+ def will_save
29
+ attributes.fetch(:willSave)
30
+ end
31
+
32
+ #
33
+ # The client supports sending a will save request and
34
+ # waits for a response providing text edits which will
35
+ # be applied to the document before it is saved.
36
+ #
37
+ # @return [boolean]
38
+ def will_save_wait_until
39
+ attributes.fetch(:willSaveWaitUntil)
40
+ end
41
+
42
+ #
43
+ # The client supports did save notifications.
44
+ #
45
+ # @return [boolean]
46
+ def did_save
47
+ attributes.fetch(:didSave)
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
@@ -15,7 +15,10 @@ module LanguageServer
15
15
  end
16
16
 
17
17
  #
18
- # Open and close notifications are sent to the server.
18
+ # Open and close notifications are sent to the server. If omitted open close notification should not
19
+ # be sent.
20
+ # Open and close notifications are sent to the server. If omitted open close notification should not
21
+ # be sent.
19
22
  #
20
23
  # @return [boolean]
21
24
  def open_close
@@ -25,14 +28,17 @@ module LanguageServer
25
28
  #
26
29
  # Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
27
30
  # and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.
31
+ # Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full
32
+ # and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.
28
33
  #
29
- # @return [number]
34
+ # @return [any]
30
35
  def change
31
36
  attributes.fetch(:change)
32
37
  end
33
38
 
34
39
  #
35
- # Will save notifications are sent to the server.
40
+ # If present will save notifications are sent to the server. If omitted the notification should not be
41
+ # sent.
36
42
  #
37
43
  # @return [boolean]
38
44
  def will_save
@@ -40,7 +46,8 @@ module LanguageServer
40
46
  end
41
47
 
42
48
  #
43
- # Will save wait until requests are sent to the server.
49
+ # If present will save wait until requests are sent to the server. If omitted the request should not be
50
+ # sent.
44
51
  #
45
52
  # @return [boolean]
46
53
  def will_save_wait_until
@@ -48,9 +55,10 @@ module LanguageServer
48
55
  end
49
56
 
50
57
  #
51
- # Save notifications are sent to the server.
58
+ # If present save notifications are sent to the server. If omitted the notification should not be
59
+ # sent.
52
60
  #
53
- # @return [SaveOptions]
61
+ # @return [boolean | SaveOptions]
54
62
  def save
55
63
  attributes.fetch(:save)
56
64
  end
@@ -0,0 +1,44 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class TypeDefinitionClientCapabilities
5
+ def initialize(dynamic_registration: nil, link_support: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
9
+ @attributes[:linkSupport] = link_support if link_support
10
+
11
+ @attributes.freeze
12
+ end
13
+
14
+ #
15
+ # Whether implementation supports dynamic registration. If this is set to `true`
16
+ # the client supports the new `TypeDefinitionRegistrationOptions` return value
17
+ # for the corresponding server capability as well.
18
+ #
19
+ # @return [boolean]
20
+ def dynamic_registration
21
+ attributes.fetch(:dynamicRegistration)
22
+ end
23
+
24
+ #
25
+ # The client supports additional metadata in the form of definition links.
26
+ #
27
+ # @return [boolean]
28
+ def link_support
29
+ attributes.fetch(:linkSupport)
30
+ end
31
+
32
+ attr_reader :attributes
33
+
34
+ def to_hash
35
+ attributes
36
+ end
37
+
38
+ def to_json(*args)
39
+ to_hash.to_json(*args)
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,25 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class TypeDefinitionOptions < 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,25 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class TypeDefinitionParams < PartialResultParams
5
+ def initialize(partial_result_token: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:partialResultToken] = partial_result_token if partial_result_token
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,25 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class TypeDefinitionRegistrationOptions < 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
@@ -5,6 +5,7 @@ module LanguageServer
5
5
  def initialize(uri:, version:)
6
6
  @attributes = {}
7
7
 
8
+ @attributes[:uri] = uri
8
9
  @attributes[:version] = version
9
10
 
10
11
  @attributes.freeze
@@ -15,7 +16,7 @@ module LanguageServer
15
16
  # is sent from the server to the client and the file is not open in the editor
16
17
  # (the server has not received an open notification before) the server can send
17
18
  # `null` to indicate that the version is known and the content on disk is the
18
- # truth (as speced with document content ownership).
19
+ # master (as speced with document content ownership).
19
20
  #
20
21
  # The version number of a document will increase after each change, including
21
22
  # undo/redo. The number doesn't need to be consecutive.
@@ -0,0 +1,80 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class WorkDoneProgressBegin
5
+ def initialize(kind:, title:, cancellable: nil, message: nil, percentage: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:kind] = kind
9
+ @attributes[:title] = title
10
+ @attributes[:cancellable] = cancellable if cancellable
11
+ @attributes[:message] = message if message
12
+ @attributes[:percentage] = percentage if percentage
13
+
14
+ @attributes.freeze
15
+ end
16
+
17
+ # @return ["begin"]
18
+ def kind
19
+ attributes.fetch(:kind)
20
+ end
21
+
22
+ #
23
+ # Mandatory title of the progress operation. Used to briefly inform about
24
+ # the kind of operation being performed.
25
+ #
26
+ # Examples: "Indexing" or "Linking dependencies".
27
+ #
28
+ # @return [string]
29
+ def title
30
+ attributes.fetch(:title)
31
+ end
32
+
33
+ #
34
+ # Controls if a cancel button should show to allow the user to cancel the
35
+ # long running operation. Clients that don't support cancellation are allowed
36
+ # to ignore the setting.
37
+ #
38
+ # @return [boolean]
39
+ def cancellable
40
+ attributes.fetch(:cancellable)
41
+ end
42
+
43
+ #
44
+ # Optional, more detailed associated progress message. Contains
45
+ # complementary information to the `title`.
46
+ #
47
+ # Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
48
+ # If unset, the previous progress message (if any) is still valid.
49
+ #
50
+ # @return [string]
51
+ def message
52
+ attributes.fetch(:message)
53
+ end
54
+
55
+ #
56
+ # Optional progress percentage to display (value 100 is considered 100%).
57
+ # If not provided infinite progress is assumed and clients are allowed
58
+ # to ignore the `percentage` value in subsequent in report notifications.
59
+ #
60
+ # The value should be steadily rising. Clients are free to ignore values
61
+ # that are not following this rule.
62
+ #
63
+ # @return [number]
64
+ def percentage
65
+ attributes.fetch(:percentage)
66
+ end
67
+
68
+ attr_reader :attributes
69
+
70
+ def to_hash
71
+ attributes
72
+ end
73
+
74
+ def to_json(*args)
75
+ to_hash.to_json(*args)
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,33 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class WorkDoneProgressCancelParams
5
+ def initialize(token:)
6
+ @attributes = {}
7
+
8
+ @attributes[:token] = token
9
+
10
+ @attributes.freeze
11
+ end
12
+
13
+ #
14
+ # The token to be used to report progress.
15
+ #
16
+ # @return [string | number]
17
+ def token
18
+ attributes.fetch(:token)
19
+ end
20
+
21
+ attr_reader :attributes
22
+
23
+ def to_hash
24
+ attributes
25
+ end
26
+
27
+ def to_json(*args)
28
+ to_hash.to_json(*args)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,33 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class WorkDoneProgressCreateParams
5
+ def initialize(token:)
6
+ @attributes = {}
7
+
8
+ @attributes[:token] = token
9
+
10
+ @attributes.freeze
11
+ end
12
+
13
+ #
14
+ # The token to be used to report progress.
15
+ #
16
+ # @return [string | number]
17
+ def token
18
+ attributes.fetch(:token)
19
+ end
20
+
21
+ attr_reader :attributes
22
+
23
+ def to_hash
24
+ attributes
25
+ end
26
+
27
+ def to_json(*args)
28
+ to_hash.to_json(*args)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end