Class: LanguageServer::Protocol::Interface::CodeActionOptions
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::CodeActionOptions
- Defined in:
- lib/language_server/protocol/interface/code_action_options.rb
Overview
Provider options for a [CodeActionRequest](#CodeActionRequest).
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#code_action_kinds ⇒ CodeActionKind[] | nil
CodeActionKinds that this server may return.
-
#initialize(code_action_kinds: nil, resolve_provider: nil, work_done_progress: nil) ⇒ CodeActionOptions
constructor
A new instance of CodeActionOptions.
-
#resolve_provider ⇒ boolean | nil
The server provides support to resolve additional information for a code action.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
- #work_done_progress ⇒ boolean | nil
Constructor Details
#initialize(code_action_kinds: nil, resolve_provider: nil, work_done_progress: nil) ⇒ CodeActionOptions
Returns a new instance of CodeActionOptions.
8 9 10 11 12 13 14 15 16 |
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 8 def initialize(code_action_kinds: nil, resolve_provider: nil, work_done_progress: nil) @attributes = {} @attributes[:codeActionKinds] = code_action_kinds if code_action_kinds @attributes[:resolveProvider] = resolve_provider if resolve_provider @attributes[:workDoneProgress] = work_done_progress if work_done_progress @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
45 46 47 |
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 45 def attributes @attributes end |
Instance Method Details
#code_action_kinds ⇒ CodeActionKind[] | nil
CodeActionKinds that this server may return.
The list of kinds may be generic, such as CodeActionKind.Refactor, or the server may list out every specific kind they provide.
25 26 27 |
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 25 def code_action_kinds attributes.fetch(:codeActionKinds) end |
#resolve_provider ⇒ boolean | nil
The server provides support to resolve additional information for a code action.
36 37 38 |
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 36 def resolve_provider attributes.fetch(:resolveProvider) end |
#to_hash ⇒ Object
47 48 49 |
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 47 def to_hash attributes end |
#to_json(*args) ⇒ Object
51 52 53 |
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 51 def to_json(*args) to_hash.to_json(*args) end |
#work_done_progress ⇒ boolean | nil
41 42 43 |
# File 'lib/language_server/protocol/interface/code_action_options.rb', line 41 def work_done_progress attributes.fetch(:workDoneProgress) end |