language_server-protocol 3.15.0.2 → 3.16.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/language_server/protocol/constant.rb +10 -0
  4. data/lib/language_server/protocol/constant/code_action_kind.rb +6 -4
  5. data/lib/language_server/protocol/constant/completion_item_tag.rb +2 -2
  6. data/lib/language_server/protocol/constant/completion_trigger_kind.rb +2 -1
  7. data/lib/language_server/protocol/constant/diagnostic_tag.rb +2 -2
  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 +2 -1
  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 -2
  18. data/lib/language_server/protocol/constant/token_format.rb +9 -0
  19. data/lib/language_server/protocol/interface.rb +112 -0
  20. data/lib/language_server/protocol/interface/annotated_text_edit.rb +38 -0
  21. data/lib/language_server/protocol/interface/apply_workspace_edit_response.rb +15 -4
  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 +31 -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 +25 -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 +31 -0
  29. data/lib/language_server/protocol/interface/call_hierarchy_prepare_params.rb +25 -0
  30. data/lib/language_server/protocol/interface/call_hierarchy_registration_options.rb +25 -0
  31. data/lib/language_server/protocol/interface/change_annotation.rb +57 -0
  32. data/lib/language_server/protocol/interface/client_capabilities.rb +12 -3
  33. data/lib/language_server/protocol/interface/code_action.rb +43 -8
  34. data/lib/language_server/protocol/interface/code_action_client_capabilities.rb +44 -1
  35. data/lib/language_server/protocol/interface/code_action_context.rb +7 -6
  36. data/lib/language_server/protocol/interface/code_action_options.rb +13 -3
  37. data/lib/language_server/protocol/interface/code_action_registration_options.rb +2 -1
  38. data/lib/language_server/protocol/interface/code_description.rb +36 -0
  39. data/lib/language_server/protocol/interface/code_lens.rb +5 -3
  40. data/lib/language_server/protocol/interface/code_lens_workspace_client_capabilities.rb +39 -0
  41. data/lib/language_server/protocol/interface/color_presentation.rb +7 -6
  42. data/lib/language_server/protocol/interface/completion_client_capabilities.rb +1 -1
  43. data/lib/language_server/protocol/interface/completion_context.rb +5 -3
  44. data/lib/language_server/protocol/interface/completion_item.rb +60 -29
  45. data/lib/language_server/protocol/interface/completion_list.rb +2 -2
  46. data/lib/language_server/protocol/interface/completion_options.rb +15 -12
  47. data/lib/language_server/protocol/interface/completion_params.rb +2 -1
  48. data/lib/language_server/protocol/interface/create_file.rb +10 -1
  49. data/lib/language_server/protocol/interface/create_files_params.rb +37 -0
  50. data/lib/language_server/protocol/interface/declaration_client_capabilities.rb +3 -3
  51. data/lib/language_server/protocol/interface/delete_file.rb +10 -1
  52. data/lib/language_server/protocol/interface/delete_files_params.rb +37 -0
  53. data/lib/language_server/protocol/interface/diagnostic.rb +21 -1
  54. data/lib/language_server/protocol/interface/diagnostic_related_information.rb +3 -3
  55. data/lib/language_server/protocol/interface/did_change_text_document_params.rb +11 -9
  56. data/lib/language_server/protocol/interface/did_change_watched_files_client_capabilities.rb +3 -3
  57. data/lib/language_server/protocol/interface/document_filter.rb +7 -3
  58. data/lib/language_server/protocol/interface/document_highlight.rb +1 -1
  59. data/lib/language_server/protocol/interface/document_link.rb +6 -5
  60. data/lib/language_server/protocol/interface/document_symbol.rb +23 -11
  61. data/lib/language_server/protocol/interface/document_symbol_client_capabilities.rb +24 -2
  62. data/lib/language_server/protocol/interface/document_symbol_options.rb +11 -1
  63. data/lib/language_server/protocol/interface/document_symbol_registration_options.rb +2 -1
  64. data/lib/language_server/protocol/interface/file_create.rb +36 -0
  65. data/lib/language_server/protocol/interface/file_delete.rb +36 -0
  66. data/lib/language_server/protocol/interface/file_operation_filter.rb +46 -0
  67. data/lib/language_server/protocol/interface/file_operation_pattern.rb +67 -0
  68. data/lib/language_server/protocol/interface/file_operation_pattern_options.rb +36 -0
  69. data/lib/language_server/protocol/interface/file_operation_registration_options.rb +36 -0
  70. data/lib/language_server/protocol/interface/file_rename.rb +45 -0
  71. data/lib/language_server/protocol/interface/file_system_watcher.rb +7 -3
  72. data/lib/language_server/protocol/interface/folding_range.rb +17 -8
  73. data/lib/language_server/protocol/interface/folding_range_client_capabilities.rb +10 -7
  74. data/lib/language_server/protocol/interface/hover.rb +1 -1
  75. data/lib/language_server/protocol/interface/hover_client_capabilities.rb +3 -2
  76. data/lib/language_server/protocol/interface/implementation_client_capabilities.rb +3 -3
  77. data/lib/language_server/protocol/interface/initialize_params.rb +20 -5
  78. data/lib/language_server/protocol/interface/insert_replace_edit.rb +54 -0
  79. data/lib/language_server/protocol/interface/linked_editing_range_client_capabilities.rb +36 -0
  80. data/lib/language_server/protocol/interface/linked_editing_range_options.rb +25 -0
  81. data/lib/language_server/protocol/interface/linked_editing_range_params.rb +25 -0
  82. data/lib/language_server/protocol/interface/linked_editing_range_registration_options.rb +25 -0
  83. data/lib/language_server/protocol/interface/linked_editing_ranges.rb +45 -0
  84. data/lib/language_server/protocol/interface/location_link.rb +9 -7
  85. data/lib/language_server/protocol/interface/log_message_params.rb +1 -1
  86. data/lib/language_server/protocol/interface/log_trace_params.rb +43 -0
  87. data/lib/language_server/protocol/interface/markdown_client_capabilities.rb +45 -0
  88. data/lib/language_server/protocol/interface/markup_content.rb +9 -7
  89. data/lib/language_server/protocol/interface/moniker.rb +64 -0
  90. data/lib/language_server/protocol/interface/moniker_client_capabilities.rb +36 -0
  91. data/lib/language_server/protocol/interface/moniker_options.rb +25 -0
  92. data/lib/language_server/protocol/interface/moniker_params.rb +25 -0
  93. data/lib/language_server/protocol/interface/moniker_registration_options.rb +25 -0
  94. data/lib/language_server/protocol/interface/optional_versioned_text_document_identifier.rb +42 -0
  95. data/lib/language_server/protocol/interface/parameter_information.rb +7 -5
  96. data/lib/language_server/protocol/interface/partial_result_params.rb +3 -3
  97. data/lib/language_server/protocol/interface/position.rb +5 -5
  98. data/lib/language_server/protocol/interface/progress_params.rb +1 -1
  99. data/lib/language_server/protocol/interface/publish_diagnostics_client_capabilities.rb +21 -1
  100. data/lib/language_server/protocol/interface/publish_diagnostics_params.rb +2 -1
  101. data/lib/language_server/protocol/interface/regular_expressions_client_capabilities.rb +45 -0
  102. data/lib/language_server/protocol/interface/rename_client_capabilities.rb +27 -1
  103. data/lib/language_server/protocol/interface/rename_file.rb +10 -1
  104. data/lib/language_server/protocol/interface/rename_files_params.rb +38 -0
  105. data/lib/language_server/protocol/interface/selection_range.rb +2 -1
  106. data/lib/language_server/protocol/interface/selection_range_client_capabilities.rb +4 -3
  107. data/lib/language_server/protocol/interface/semantic_tokens.rb +45 -0
  108. data/lib/language_server/protocol/interface/semantic_tokens_client_capabilities.rb +97 -0
  109. data/lib/language_server/protocol/interface/semantic_tokens_delta.rb +40 -0
  110. data/lib/language_server/protocol/interface/semantic_tokens_delta_params.rb +44 -0
  111. data/lib/language_server/protocol/interface/semantic_tokens_delta_partial_result.rb +30 -0
  112. data/lib/language_server/protocol/interface/semantic_tokens_edit.rb +51 -0
  113. data/lib/language_server/protocol/interface/semantic_tokens_legend.rb +42 -0
  114. data/lib/language_server/protocol/interface/semantic_tokens_options.rb +53 -0
  115. data/lib/language_server/protocol/interface/semantic_tokens_params.rb +34 -0
  116. data/lib/language_server/protocol/interface/semantic_tokens_partial_result.rb +30 -0
  117. data/lib/language_server/protocol/interface/semantic_tokens_range_params.rb +43 -0
  118. data/lib/language_server/protocol/interface/semantic_tokens_registration_options.rb +25 -0
  119. data/lib/language_server/protocol/interface/semantic_tokens_workspace_client_capabilities.rb +39 -0
  120. data/lib/language_server/protocol/interface/server_capabilities.rb +47 -9
  121. data/lib/language_server/protocol/interface/set_trace_params.rb +33 -0
  122. data/lib/language_server/protocol/interface/show_document_client_capabilities.rb +37 -0
  123. data/lib/language_server/protocol/interface/show_document_params.rb +71 -0
  124. data/lib/language_server/protocol/interface/show_document_result.rb +36 -0
  125. data/lib/language_server/protocol/interface/show_message_params.rb +1 -1
  126. data/lib/language_server/protocol/interface/show_message_request_client_capabilities.rb +36 -0
  127. data/lib/language_server/protocol/interface/show_message_request_params.rb +1 -1
  128. data/lib/language_server/protocol/interface/signature_help.rb +3 -3
  129. data/lib/language_server/protocol/interface/signature_help_client_capabilities.rb +1 -1
  130. data/lib/language_server/protocol/interface/signature_help_context.rb +10 -7
  131. data/lib/language_server/protocol/interface/signature_help_options.rb +3 -2
  132. data/lib/language_server/protocol/interface/signature_help_params.rb +3 -2
  133. data/lib/language_server/protocol/interface/signature_information.rb +12 -1
  134. data/lib/language_server/protocol/interface/symbol_information.rb +10 -1
  135. data/lib/language_server/protocol/interface/text_document_change_registration_options.rb +1 -1
  136. data/lib/language_server/protocol/interface/text_document_client_capabilities.rb +39 -2
  137. data/lib/language_server/protocol/interface/text_document_content_change_event.rb +2 -2
  138. data/lib/language_server/protocol/interface/text_document_edit.rb +2 -2
  139. data/lib/language_server/protocol/interface/text_document_registration_options.rb +3 -3
  140. data/lib/language_server/protocol/interface/text_document_sync_options.rb +13 -15
  141. data/lib/language_server/protocol/interface/type_definition_client_capabilities.rb +3 -3
  142. data/lib/language_server/protocol/interface/versioned_text_document_identifier.rb +3 -7
  143. data/lib/language_server/protocol/interface/will_save_text_document_params.rb +1 -1
  144. data/lib/language_server/protocol/interface/work_done_progress_begin.rb +3 -3
  145. data/lib/language_server/protocol/interface/work_done_progress_cancel_params.rb +1 -1
  146. data/lib/language_server/protocol/interface/work_done_progress_create_params.rb +1 -1
  147. data/lib/language_server/protocol/interface/work_done_progress_params.rb +1 -1
  148. data/lib/language_server/protocol/interface/work_done_progress_report.rb +5 -5
  149. data/lib/language_server/protocol/interface/workspace_edit.rb +24 -7
  150. data/lib/language_server/protocol/interface/workspace_edit_client_capabilities.rb +23 -1
  151. data/lib/language_server/protocol/interface/workspace_symbol_client_capabilities.rb +13 -2
  152. data/lib/language_server/protocol/version.rb +1 -1
  153. metadata +67 -6
@@ -2,9 +2,9 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  #
5
- # Represents a related message and source code location for a diagnostic. This should be
6
- # used to point to code locations that cause or are related to a diagnostics, e.g when duplicating
7
- # a symbol in a scope.
5
+ # Represents a related message and source code location for a diagnostic.
6
+ # This should be used to point to code locations that cause or are related to
7
+ # a diagnostics, e.g when duplicating a symbol in a scope.
8
8
  #
9
9
  class DiagnosticRelatedInformation
10
10
  def initialize(location:, message:)
@@ -22,17 +22,19 @@ module LanguageServer
22
22
  end
23
23
 
24
24
  #
25
- # The actual content changes. The content changes describe single state changes
26
- # to the document. So if there are two content changes c1 (at array index 0) and
27
- # c2 (at array index 1) for a document in state S then c1 moves the document from
28
- # S to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed
29
- # on the state S'.
25
+ # The actual content changes. The content changes describe single state
26
+ # changes to the document. So if there are two content changes c1 (at
27
+ # array index 0) and c2 (at array index 1) for a document in state S then
28
+ # c1 moves the document from S to S' and c2 from S' to S''. So c1 is
29
+ # computed on the state S and c2 is computed on the state S'.
30
30
  #
31
- # To mirror the content of a document using change events use the following approach:
31
+ # To mirror the content of a document using change events use the following
32
+ # approach:
32
33
  # - start with the same initial content
33
- # - apply the 'textDocument/didChange' notifications in the order you recevie them.
34
- # - apply the `TextDocumentContentChangeEvent`s in a single notification in the order
35
- # you receive them.
34
+ # - apply the 'textDocument/didChange' notifications in the order you
35
+ # receive them.
36
+ # - apply the `TextDocumentContentChangeEvent`s in a single notification
37
+ # in the order you receive them.
36
38
  #
37
39
  # @return [TextDocumentContentChangeEvent[]]
38
40
  def content_changes
@@ -11,9 +11,9 @@ module LanguageServer
11
11
  end
12
12
 
13
13
  #
14
- # Did change watched files notification supports dynamic registration. Please note
15
- # that the current protocol doesn't support static configuration for file changes
16
- # from the server side.
14
+ # Did change watched files notification supports dynamic registration.
15
+ # Please note that the current protocol doesn't support static
16
+ # configuration for file changes from the server side.
17
17
  #
18
18
  # @return [boolean]
19
19
  def dynamic_registration
@@ -35,9 +35,13 @@ module LanguageServer
35
35
  # - `*` to match one or more characters in a path segment
36
36
  # - `?` to match on one character in a path segment
37
37
  # - `**` to match any number of path segments, including none
38
- # - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
39
- # - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
40
- # - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
38
+ # - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}`
39
+ # matches all TypeScript and JavaScript files)
40
+ # - `[]` to declare a range of characters to match in a path segment
41
+ # (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
42
+ # - `[!...]` to negate a range of characters to match in a path segment
43
+ # (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but
44
+ # not `example.0`)
41
45
  #
42
46
  # @return [string]
43
47
  def pattern
@@ -27,7 +27,7 @@ module LanguageServer
27
27
  #
28
28
  # The highlight kind, default is DocumentHighlightKind.Text.
29
29
  #
30
- # @return [number]
30
+ # @return [DocumentHighlightKind]
31
31
  def kind
32
32
  attributes.fetch(:kind)
33
33
  end
@@ -2,8 +2,8 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  #
5
- # A document link is a range in a text document that links to an internal or external resource, like another
6
- # text document or a web site.
5
+ # A document link is a range in a text document that links to an internal or
6
+ # external resource, like another text document or a web site.
7
7
  #
8
8
  class DocumentLink
9
9
  def initialize(range:, target: nil, tooltip: nil, data: nil)
@@ -36,9 +36,10 @@ module LanguageServer
36
36
  #
37
37
  # The tooltip text when you hover over this link.
38
38
  #
39
- # If a tooltip is provided, is will be displayed in a string that includes instructions on how to
40
- # trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,
41
- # user settings, and localization.
39
+ # If a tooltip is provided, is will be displayed in a string that includes
40
+ # instructions on how to trigger the link, such as `{0} (ctrl + click)`.
41
+ # The specific instructions vary depending on OS, user settings, and
42
+ # localization.
42
43
  #
43
44
  # @return [string]
44
45
  def tooltip
@@ -2,17 +2,19 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  #
5
- # Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be
6
- # hierarchical and they have two ranges: one that encloses its definition and one that points to its most interesting range,
7
- # e.g. the range of an identifier.
5
+ # Represents programming constructs like variables, classes, interfaces etc.
6
+ # that appear in a document. Document symbols can be hierarchical and they
7
+ # have two ranges: one that encloses its definition and one that points to its
8
+ # most interesting range, e.g. the range of an identifier.
8
9
  #
9
10
  class DocumentSymbol
10
- def initialize(name:, detail: nil, kind:, deprecated: nil, range:, selection_range:, children: nil)
11
+ def initialize(name:, detail: nil, kind:, tags: nil, deprecated: nil, range:, selection_range:, children: nil)
11
12
  @attributes = {}
12
13
 
13
14
  @attributes[:name] = name
14
15
  @attributes[:detail] = detail if detail
15
16
  @attributes[:kind] = kind
17
+ @attributes[:tags] = tags if tags
16
18
  @attributes[:deprecated] = deprecated if deprecated
17
19
  @attributes[:range] = range
18
20
  @attributes[:selectionRange] = selection_range
@@ -22,8 +24,9 @@ module LanguageServer
22
24
  end
23
25
 
24
26
  #
25
- # The name of this symbol. Will be displayed in the user interface and therefore must not be
26
- # an empty string or a string only consisting of white spaces.
27
+ # The name of this symbol. Will be displayed in the user interface and
28
+ # therefore must not be an empty string or a string only consisting of
29
+ # white spaces.
27
30
  #
28
31
  # @return [string]
29
32
  def name
@@ -46,6 +49,14 @@ module LanguageServer
46
49
  attributes.fetch(:kind)
47
50
  end
48
51
 
52
+ #
53
+ # Tags for this document symbol.
54
+ #
55
+ # @return [1[]]
56
+ def tags
57
+ attributes.fetch(:tags)
58
+ end
59
+
49
60
  #
50
61
  # Indicates if this symbol is deprecated.
51
62
  #
@@ -55,9 +66,10 @@ module LanguageServer
55
66
  end
56
67
 
57
68
  #
58
- # The range enclosing this symbol not including leading/trailing whitespace but everything else
59
- # like comments. This information is typically used to determine if the clients cursor is
60
- # inside the symbol to reveal in the symbol in the UI.
69
+ # The range enclosing this symbol not including leading/trailing whitespace
70
+ # but everything else like comments. This information is typically used to
71
+ # determine if the clients cursor is inside the symbol to reveal in the
72
+ # symbol in the UI.
61
73
  #
62
74
  # @return [Range]
63
75
  def range
@@ -65,8 +77,8 @@ module LanguageServer
65
77
  end
66
78
 
67
79
  #
68
- # The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.
69
- # Must be contained by the `range`.
80
+ # The range that should be selected and revealed when this symbol is being
81
+ # picked, e.g. the name of a function. Must be contained by the `range`.
70
82
  #
71
83
  # @return [Range]
72
84
  def selection_range
@@ -2,12 +2,14 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class DocumentSymbolClientCapabilities
5
- def initialize(dynamic_registration: nil, symbol_kind: nil, hierarchical_document_symbol_support: nil)
5
+ def initialize(dynamic_registration: nil, symbol_kind: nil, hierarchical_document_symbol_support: nil, tag_support: nil, label_support: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
9
9
  @attributes[:symbolKind] = symbol_kind if symbol_kind
10
10
  @attributes[:hierarchicalDocumentSymbolSupport] = hierarchical_document_symbol_support if hierarchical_document_symbol_support
11
+ @attributes[:tagSupport] = tag_support if tag_support
12
+ @attributes[:labelSupport] = label_support if label_support
11
13
 
12
14
  @attributes.freeze
13
15
  end
@@ -21,7 +23,8 @@ module LanguageServer
21
23
  end
22
24
 
23
25
  #
24
- # Specific capabilities for the `SymbolKind` in the `textDocument/documentSymbol` request.
26
+ # Specific capabilities for the `SymbolKind` in the
27
+ # `textDocument/documentSymbol` request.
25
28
  #
26
29
  # @return [{ valueSet?: any[]; }]
27
30
  def symbol_kind
@@ -36,6 +39,25 @@ module LanguageServer
36
39
  attributes.fetch(:hierarchicalDocumentSymbolSupport)
37
40
  end
38
41
 
42
+ #
43
+ # The client supports tags on `SymbolInformation`. Tags are supported on
44
+ # `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true.
45
+ # Clients supporting tags have to handle unknown tags gracefully.
46
+ #
47
+ # @return [{ valueSet: 1[]; }]
48
+ def tag_support
49
+ attributes.fetch(:tagSupport)
50
+ end
51
+
52
+ #
53
+ # The client supports an additional label presented in the UI when
54
+ # registering a document symbol provider.
55
+ #
56
+ # @return [boolean]
57
+ def label_support
58
+ attributes.fetch(:labelSupport)
59
+ end
60
+
39
61
  attr_reader :attributes
40
62
 
41
63
  def to_hash
@@ -2,14 +2,24 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class DocumentSymbolOptions < WorkDoneProgressOptions
5
- def initialize(work_done_progress: nil)
5
+ def initialize(work_done_progress: nil, label: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
9
+ @attributes[:label] = label if label
9
10
 
10
11
  @attributes.freeze
11
12
  end
12
13
 
14
+ #
15
+ # A human-readable string that is shown when multiple outlines trees
16
+ # are shown for the same document.
17
+ #
18
+ # @return [string]
19
+ def label
20
+ attributes.fetch(:label)
21
+ end
22
+
13
23
  attr_reader :attributes
14
24
 
15
25
  def to_hash
@@ -2,10 +2,11 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class DocumentSymbolRegistrationOptions < DocumentSymbolOptions
5
- def initialize(work_done_progress: nil)
5
+ def initialize(work_done_progress: nil, label: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
9
+ @attributes[:label] = label if label
9
10
 
10
11
  @attributes.freeze
11
12
  end
@@ -0,0 +1,36 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Represents information on a file/folder create.
6
+ #
7
+ class FileCreate
8
+ def initialize(uri:)
9
+ @attributes = {}
10
+
11
+ @attributes[:uri] = uri
12
+
13
+ @attributes.freeze
14
+ end
15
+
16
+ #
17
+ # A file:// URI for the location of the file/folder being created.
18
+ #
19
+ # @return [string]
20
+ def uri
21
+ attributes.fetch(:uri)
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
@@ -0,0 +1,36 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Represents information on a file/folder delete.
6
+ #
7
+ class FileDelete
8
+ def initialize(uri:)
9
+ @attributes = {}
10
+
11
+ @attributes[:uri] = uri
12
+
13
+ @attributes.freeze
14
+ end
15
+
16
+ #
17
+ # A file:// URI for the location of the file/folder being deleted.
18
+ #
19
+ # @return [string]
20
+ def uri
21
+ attributes.fetch(:uri)
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
@@ -0,0 +1,46 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # A filter to describe in which file operation requests or notifications
6
+ # the server is interested in.
7
+ #
8
+ class FileOperationFilter
9
+ def initialize(scheme: nil, pattern:)
10
+ @attributes = {}
11
+
12
+ @attributes[:scheme] = scheme if scheme
13
+ @attributes[:pattern] = pattern
14
+
15
+ @attributes.freeze
16
+ end
17
+
18
+ #
19
+ # A Uri like `file` or `untitled`.
20
+ #
21
+ # @return [string]
22
+ def scheme
23
+ attributes.fetch(:scheme)
24
+ end
25
+
26
+ #
27
+ # The actual file operation pattern.
28
+ #
29
+ # @return [FileOperationPattern]
30
+ def pattern
31
+ attributes.fetch(:pattern)
32
+ end
33
+
34
+ attr_reader :attributes
35
+
36
+ def to_hash
37
+ attributes
38
+ end
39
+
40
+ def to_json(*args)
41
+ to_hash.to_json(*args)
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,67 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # A pattern to describe in which file operation requests or notifications
6
+ # the server is interested in.
7
+ #
8
+ class FileOperationPattern
9
+ def initialize(glob:, matches: nil, options: nil)
10
+ @attributes = {}
11
+
12
+ @attributes[:glob] = glob
13
+ @attributes[:matches] = matches if matches
14
+ @attributes[:options] = options if options
15
+
16
+ @attributes.freeze
17
+ end
18
+
19
+ #
20
+ # The glob pattern to match. Glob patterns can have the following syntax:
21
+ # - `*` to match one or more characters in a path segment
22
+ # - `?` to match on one character in a path segment
23
+ # - `**` to match any number of path segments, including none
24
+ # - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}`
25
+ # matches all TypeScript and JavaScript files)
26
+ # - `[]` to declare a range of characters to match in a path segment
27
+ # (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
28
+ # - `[!...]` to negate a range of characters to match in a path segment
29
+ # (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but
30
+ # not `example.0`)
31
+ #
32
+ # @return [string]
33
+ def glob
34
+ attributes.fetch(:glob)
35
+ end
36
+
37
+ #
38
+ # Whether to match files or folders with this pattern.
39
+ #
40
+ # Matches both if undefined.
41
+ #
42
+ # @return [FileOperationPatternKind]
43
+ def matches
44
+ attributes.fetch(:matches)
45
+ end
46
+
47
+ #
48
+ # Additional options used during matching.
49
+ #
50
+ # @return [FileOperationPatternOptions]
51
+ def options
52
+ attributes.fetch(:options)
53
+ end
54
+
55
+ attr_reader :attributes
56
+
57
+ def to_hash
58
+ attributes
59
+ end
60
+
61
+ def to_json(*args)
62
+ to_hash.to_json(*args)
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end