language_server-protocol 3.15.0.2 → 3.16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -0,0 +1,57 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Additional information that describes document changes.
6
+ #
7
+ class ChangeAnnotation
8
+ def initialize(label:, needs_confirmation: nil, description: nil)
9
+ @attributes = {}
10
+
11
+ @attributes[:label] = label
12
+ @attributes[:needsConfirmation] = needs_confirmation if needs_confirmation
13
+ @attributes[:description] = description if description
14
+
15
+ @attributes.freeze
16
+ end
17
+
18
+ #
19
+ # A human-readable string describing the actual change. The string
20
+ # is rendered prominent in the user interface.
21
+ #
22
+ # @return [string]
23
+ def label
24
+ attributes.fetch(:label)
25
+ end
26
+
27
+ #
28
+ # A flag which indicates that user confirmation is needed
29
+ # before applying the change.
30
+ #
31
+ # @return [boolean]
32
+ def needs_confirmation
33
+ attributes.fetch(:needsConfirmation)
34
+ end
35
+
36
+ #
37
+ # A human-readable string which is rendered less prominent in
38
+ # the user interface.
39
+ #
40
+ # @return [string]
41
+ def description
42
+ attributes.fetch(:description)
43
+ end
44
+
45
+ attr_reader :attributes
46
+
47
+ def to_hash
48
+ attributes
49
+ end
50
+
51
+ def to_json(*args)
52
+ to_hash.to_json(*args)
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -2,12 +2,13 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class ClientCapabilities
5
- def initialize(workspace: nil, text_document: nil, window: nil, experimental: nil)
5
+ def initialize(workspace: nil, text_document: nil, window: nil, general: nil, experimental: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:workspace] = workspace if workspace
9
9
  @attributes[:textDocument] = text_document if text_document
10
10
  @attributes[:window] = window if window
11
+ @attributes[:general] = general if general
11
12
  @attributes[:experimental] = experimental if experimental
12
13
 
13
14
  @attributes.freeze
@@ -16,7 +17,7 @@ module LanguageServer
16
17
  #
17
18
  # Workspace specific client capabilities.
18
19
  #
19
- # @return [{ applyEdit?: boolean; workspaceEdit?: WorkspaceEditClientCapabilities; didChangeConfiguration?: ...]
20
+ # @return [{ applyEdit?: boolean; workspaceEdit?: WorkspaceEditClientCapabilities; didChangeConfiguration?: DidChangeConfigurationClientCapabilities; ... 7 more ...; fileOperations?: { ...; }; }]
20
21
  def workspace
21
22
  attributes.fetch(:workspace)
22
23
  end
@@ -32,11 +33,19 @@ module LanguageServer
32
33
  #
33
34
  # Window specific client capabilities.
34
35
  #
35
- # @return [{ workDoneProgress?: boolean; }]
36
+ # @return [{ workDoneProgress?: boolean; showMessage?: ShowMessageRequestClientCapabilities; showDocument?: ShowDocumentClientCapabilities; }]
36
37
  def window
37
38
  attributes.fetch(:window)
38
39
  end
39
40
 
41
+ #
42
+ # General client capabilities.
43
+ #
44
+ # @return [{ regularExpressions?: RegularExpressionsClientCapabilities; markdown?: MarkdownClientCapabilities; }]
45
+ def general
46
+ attributes.fetch(:general)
47
+ end
48
+
40
49
  #
41
50
  # Experimental client capabilities.
42
51
  #
@@ -2,21 +2,24 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  #
5
- # A code action represents a change that can be performed in code, e.g. to fix a problem or
6
- # to refactor code.
5
+ # A code action represents a change that can be performed in code, e.g. to fix
6
+ # a problem or to refactor code.
7
7
  #
8
- # A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed.
8
+ # A CodeAction must set either `edit` and/or a `command`. If both are supplied,
9
+ # the `edit` is applied first, then the `command` is executed.
9
10
  #
10
11
  class CodeAction
11
- def initialize(title:, kind: nil, diagnostics: nil, is_preferred: nil, edit: nil, command: nil)
12
+ def initialize(title:, kind: nil, diagnostics: nil, is_preferred: nil, disabled: nil, edit: nil, command: nil, data: nil)
12
13
  @attributes = {}
13
14
 
14
15
  @attributes[:title] = title
15
16
  @attributes[:kind] = kind if kind
16
17
  @attributes[:diagnostics] = diagnostics if diagnostics
17
18
  @attributes[:isPreferred] = is_preferred if is_preferred
19
+ @attributes[:disabled] = disabled if disabled
18
20
  @attributes[:edit] = edit if edit
19
21
  @attributes[:command] = command if command
22
+ @attributes[:data] = data if data
20
23
 
21
24
  @attributes.freeze
22
25
  end
@@ -48,17 +51,40 @@ module LanguageServer
48
51
  end
49
52
 
50
53
  #
51
- # Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted
52
- # by keybindings.
54
+ # Marks this as a preferred action. Preferred actions are used by the
55
+ # `auto fix` command and can be targeted by keybindings.
53
56
  #
54
- # A quick fix should be marked preferred if it properly addresses the underlying error.
55
- # A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
57
+ # A quick fix should be marked preferred if it properly addresses the
58
+ # underlying error. A refactoring should be marked preferred if it is the
59
+ # most reasonable choice of actions to take.
56
60
  #
57
61
  # @return [boolean]
58
62
  def is_preferred
59
63
  attributes.fetch(:isPreferred)
60
64
  end
61
65
 
66
+ #
67
+ # Marks that the code action cannot currently be applied.
68
+ #
69
+ # Clients should follow the following guidelines regarding disabled code
70
+ # actions:
71
+ #
72
+ # - Disabled code actions are not shown in automatic lightbulbs code
73
+ # action menus.
74
+ #
75
+ # - Disabled actions are shown as faded out in the code action menu when
76
+ # the user request a more specific type of code action, such as
77
+ # refactorings.
78
+ #
79
+ # - If the user has a keybinding that auto applies a code action and only
80
+ # a disabled code actions are returned, the client should show the user
81
+ # an error message with `reason` in the editor.
82
+ #
83
+ # @return [{ reason: string; }]
84
+ def disabled
85
+ attributes.fetch(:disabled)
86
+ end
87
+
62
88
  #
63
89
  # The workspace edit this code action performs.
64
90
  #
@@ -77,6 +103,15 @@ module LanguageServer
77
103
  attributes.fetch(:command)
78
104
  end
79
105
 
106
+ #
107
+ # A data entry field that is preserved on a code action between
108
+ # a `textDocument/codeAction` and a `codeAction/resolve` request.
109
+ #
110
+ # @return [any]
111
+ def data
112
+ attributes.fetch(:data)
113
+ end
114
+
80
115
  attr_reader :attributes
81
116
 
82
117
  def to_hash
@@ -2,12 +2,16 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class CodeActionClientCapabilities
5
- def initialize(dynamic_registration: nil, code_action_literal_support: nil, is_preferred_support: nil)
5
+ def initialize(dynamic_registration: nil, code_action_literal_support: nil, is_preferred_support: nil, disabled_support: nil, data_support: nil, resolve_support: nil, honors_change_annotations: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
9
9
  @attributes[:codeActionLiteralSupport] = code_action_literal_support if code_action_literal_support
10
10
  @attributes[:isPreferredSupport] = is_preferred_support if is_preferred_support
11
+ @attributes[:disabledSupport] = disabled_support if disabled_support
12
+ @attributes[:dataSupport] = data_support if data_support
13
+ @attributes[:resolveSupport] = resolve_support if resolve_support
14
+ @attributes[:honorsChangeAnnotations] = honors_change_annotations if honors_change_annotations
11
15
 
12
16
  @attributes.freeze
13
17
  end
@@ -37,6 +41,45 @@ module LanguageServer
37
41
  attributes.fetch(:isPreferredSupport)
38
42
  end
39
43
 
44
+ #
45
+ # Whether code action supports the `disabled` property.
46
+ #
47
+ # @return [boolean]
48
+ def disabled_support
49
+ attributes.fetch(:disabledSupport)
50
+ end
51
+
52
+ #
53
+ # Whether code action supports the `data` property which is
54
+ # preserved between a `textDocument/codeAction` and a
55
+ # `codeAction/resolve` request.
56
+ #
57
+ # @return [boolean]
58
+ def data_support
59
+ attributes.fetch(:dataSupport)
60
+ end
61
+
62
+ #
63
+ # Whether the client supports resolving additional code action
64
+ # properties via a separate `codeAction/resolve` request.
65
+ #
66
+ # @return [{ properties: string[]; }]
67
+ def resolve_support
68
+ attributes.fetch(:resolveSupport)
69
+ end
70
+
71
+ #
72
+ # Whether the client honors the change annotations in
73
+ # text edits and resource operations returned via the
74
+ # `CodeAction#edit` property by for example presenting
75
+ # the workspace edit in the user interface and asking
76
+ # for confirmation.
77
+ #
78
+ # @return [boolean]
79
+ def honors_change_annotations
80
+ attributes.fetch(:honorsChangeAnnotations)
81
+ end
82
+
40
83
  attr_reader :attributes
41
84
 
42
85
  def to_hash
@@ -16,10 +16,11 @@ module LanguageServer
16
16
  end
17
17
 
18
18
  #
19
- # An array of diagnostics known on the client side overlapping the range provided to the
20
- # `textDocument/codeAction` request. They are provided so that the server knows which
21
- # errors are currently presented to the user for the given range. There is no guarantee
22
- # that these accurately reflect the error state of the resource. The primary parameter
19
+ # An array of diagnostics known on the client side overlapping the range
20
+ # provided to the `textDocument/codeAction` request. They are provided so
21
+ # that the server knows which errors are currently presented to the user
22
+ # for the given range. There is no guarantee that these accurately reflect
23
+ # the error state of the resource. The primary parameter
23
24
  # to compute code actions is the provided range.
24
25
  #
25
26
  # @return [Diagnostic[]]
@@ -30,8 +31,8 @@ module LanguageServer
30
31
  #
31
32
  # Requested kind of actions to return.
32
33
  #
33
- # Actions not of this kind are filtered out by the client before being shown. So servers
34
- # can omit computing them.
34
+ # Actions not of this kind are filtered out by the client before being
35
+ # shown. So servers can omit computing them.
35
36
  #
36
37
  # @return [string[]]
37
38
  def only
@@ -2,11 +2,12 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class CodeActionOptions < WorkDoneProgressOptions
5
- def initialize(work_done_progress: nil, code_action_kinds: nil)
5
+ def initialize(work_done_progress: nil, code_action_kinds: nil, resolve_provider: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
9
9
  @attributes[:codeActionKinds] = code_action_kinds if code_action_kinds
10
+ @attributes[:resolveProvider] = resolve_provider if resolve_provider
10
11
 
11
12
  @attributes.freeze
12
13
  end
@@ -14,14 +15,23 @@ module LanguageServer
14
15
  #
15
16
  # CodeActionKinds that this server may return.
16
17
  #
17
- # The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server
18
- # may list out every specific kind they provide.
18
+ # The list of kinds may be generic, such as `CodeActionKind.Refactor`,
19
+ # or the server may list out every specific kind they provide.
19
20
  #
20
21
  # @return [string[]]
21
22
  def code_action_kinds
22
23
  attributes.fetch(:codeActionKinds)
23
24
  end
24
25
 
26
+ #
27
+ # The server provides support to resolve additional
28
+ # information for a code action.
29
+ #
30
+ # @return [boolean]
31
+ def resolve_provider
32
+ attributes.fetch(:resolveProvider)
33
+ end
34
+
25
35
  attr_reader :attributes
26
36
 
27
37
  def to_hash
@@ -2,11 +2,12 @@ module LanguageServer
2
2
  module Protocol
3
3
  module Interface
4
4
  class CodeActionRegistrationOptions < CodeActionOptions
5
- def initialize(work_done_progress: nil, code_action_kinds: nil)
5
+ def initialize(work_done_progress: nil, code_action_kinds: nil, resolve_provider: nil)
6
6
  @attributes = {}
7
7
 
8
8
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
9
9
  @attributes[:codeActionKinds] = code_action_kinds if code_action_kinds
10
+ @attributes[:resolveProvider] = resolve_provider if resolve_provider
10
11
 
11
12
  @attributes.freeze
12
13
  end
@@ -0,0 +1,36 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ #
5
+ # Structure to capture a description for an error code.
6
+ #
7
+ class CodeDescription
8
+ def initialize(href:)
9
+ @attributes = {}
10
+
11
+ @attributes[:href] = href
12
+
13
+ @attributes.freeze
14
+ end
15
+
16
+ #
17
+ # An URI to open with more information about the diagnostic error.
18
+ #
19
+ # @return [string]
20
+ def href
21
+ attributes.fetch(:href)
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
@@ -5,8 +5,9 @@ module LanguageServer
5
5
  # A code lens represents a command that should be shown along with
6
6
  # source text, like the number of references, a way to run tests, etc.
7
7
  #
8
- # A code lens is _unresolved_ when no command is associated to it. For performance
9
- # reasons the creation of a code lens and resolving should be done in two stages.
8
+ # A code lens is _unresolved_ when no command is associated to it. For
9
+ # performance reasons the creation of a code lens and resolving should be done
10
+ # in two stages.
10
11
  #
11
12
  class CodeLens
12
13
  def initialize(range:, command: nil, data: nil)
@@ -20,7 +21,8 @@ module LanguageServer
20
21
  end
21
22
 
22
23
  #
23
- # The range in which this code lens is valid. Should only span a single line.
24
+ # The range in which this code lens is valid. Should only span a single
25
+ # line.
24
26
  #
25
27
  # @return [Range]
26
28
  def range
@@ -0,0 +1,39 @@
1
+ module LanguageServer
2
+ module Protocol
3
+ module Interface
4
+ class CodeLensWorkspaceClientCapabilities
5
+ def initialize(refresh_support: nil)
6
+ @attributes = {}
7
+
8
+ @attributes[:refreshSupport] = refresh_support if refresh_support
9
+
10
+ @attributes.freeze
11
+ end
12
+
13
+ #
14
+ # Whether the client implementation supports a refresh request sent from the
15
+ # server to the client.
16
+ #
17
+ # Note that this event is global and will force the client to refresh all
18
+ # code lenses currently shown. It should be used with absolute care and is
19
+ # useful for situation where a server for example detect a project wide
20
+ # change that requires such a calculation.
21
+ #
22
+ # @return [boolean]
23
+ def refresh_support
24
+ attributes.fetch(:refreshSupport)
25
+ end
26
+
27
+ attr_reader :attributes
28
+
29
+ def to_hash
30
+ attributes
31
+ end
32
+
33
+ def to_json(*args)
34
+ to_hash.to_json(*args)
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -14,8 +14,8 @@ module LanguageServer
14
14
 
15
15
  #
16
16
  # The label of this color presentation. It will be shown on the color
17
- # picker header. By default this is also the text that is inserted when selecting
18
- # this color presentation.
17
+ # picker header. By default this is also the text that is inserted when
18
+ # selecting this color presentation.
19
19
  #
20
20
  # @return [string]
21
21
  def label
@@ -24,8 +24,8 @@ module LanguageServer
24
24
 
25
25
  #
26
26
  # An [edit](#TextEdit) which is applied to a document when selecting
27
- # this presentation for the color. When `falsy` the [label](#ColorPresentation.label)
28
- # is used.
27
+ # this presentation for the color. When `falsy` the
28
+ # [label](#ColorPresentation.label) is used.
29
29
  #
30
30
  # @return [TextEdit]
31
31
  def text_edit
@@ -33,8 +33,9 @@ module LanguageServer
33
33
  end
34
34
 
35
35
  #
36
- # An optional array of additional [text edits](#TextEdit) that are applied when
37
- # selecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves.
36
+ # An optional array of additional [text edits](#TextEdit) that are applied
37
+ # when selecting this color presentation. Edits must not overlap with the
38
+ # main [edit](#ColorPresentation.textEdit) nor with themselves.
38
39
  #
39
40
  # @return [TextEdit[]]
40
41
  def additional_text_edits