Class: LanguageServer::Protocol::Interface::CodeActionRegistrationOptions
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::CodeActionRegistrationOptions
- Defined in:
- lib/language_server/protocol/interface/code_action_registration_options.rb,
sig/language_server/protocol/interface/code_action_registration_options.rbs
Overview
Registration options for a CodeActionRequest.
Instance Attribute Summary collapse
-
#attributes ⇒ Hash[Symbol, untyped]
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#code_action_kinds ⇒ CodeActionKind[]
CodeActionKinds that this server may return.
-
#document_selector ⇒ DocumentSelector | nil
A document selector to identify the scope of the registration.
-
#initialize(document_selector:, code_action_kinds: nil, resolve_provider: nil, work_done_progress: nil) ⇒ CodeActionRegistrationOptions
constructor
A new instance of CodeActionRegistrationOptions.
-
#resolve_provider ⇒ boolean
The server provides support to resolve additional information for a code action.
- #to_hash ⇒ Hash[Symbol, untyped]
- #to_json(*args) ⇒ String
- #work_done_progress ⇒ boolean
Constructor Details
#initialize(document_selector:, code_action_kinds: nil, resolve_provider: nil, work_done_progress: nil) ⇒ CodeActionRegistrationOptions
Returns a new instance of CodeActionRegistrationOptions.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 8 def initialize(document_selector:, code_action_kinds: nil, resolve_provider: nil, work_done_progress: nil) @attributes = {} @attributes[:documentSelector] = document_selector @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 ⇒ Hash[Symbol, untyped] (readonly)
Returns the value of attribute attributes.
55 56 57 |
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 55 def attributes @attributes end |
Instance Method Details
#code_action_kinds ⇒ CodeActionKind[]
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.
35 36 37 |
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 35 def code_action_kinds attributes.fetch(:codeActionKinds) end |
#document_selector ⇒ DocumentSelector | nil
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
24 25 26 |
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 24 def document_selector attributes.fetch(:documentSelector) end |
#resolve_provider ⇒ boolean
The server provides support to resolve additional information for a code action.
46 47 48 |
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 46 def resolve_provider attributes.fetch(:resolveProvider) end |
#to_hash ⇒ Hash[Symbol, untyped]
57 58 59 |
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 57 def to_hash attributes end |
#to_json(*args) ⇒ String
61 62 63 |
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 61 def to_json(*args) to_hash.to_json(*args) end |
#work_done_progress ⇒ boolean
51 52 53 |
# File 'lib/language_server/protocol/interface/code_action_registration_options.rb', line 51 def work_done_progress attributes.fetch(:workDoneProgress) end |