Class: LanguageServer::Protocol::Interface::DocumentOnTypeFormattingRegistrationOptions
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::DocumentOnTypeFormattingRegistrationOptions
- Defined in:
- lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#document_selector ⇒ DocumentSelector
A document selector to identify the scope of the registration.
-
#first_trigger_character ⇒ string
A character on which formatting should be triggered, like ‘{`..
-
#initialize(document_selector:, first_trigger_character:, more_trigger_character: nil) ⇒ DocumentOnTypeFormattingRegistrationOptions
constructor
A new instance of DocumentOnTypeFormattingRegistrationOptions.
-
#more_trigger_character ⇒ string[]
More trigger characters.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(document_selector:, first_trigger_character:, more_trigger_character: nil) ⇒ DocumentOnTypeFormattingRegistrationOptions
Returns a new instance of DocumentOnTypeFormattingRegistrationOptions.
5 6 7 8 9 10 11 12 13 |
# File 'lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb', line 5 def initialize(document_selector:, first_trigger_character:, more_trigger_character: nil) @attributes = {} @attributes[:documentSelector] = document_selector @attributes[:firstTriggerCharacter] = first_trigger_character @attributes[:moreTriggerCharacter] = more_trigger_character if more_trigger_character @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
40 41 42 |
# File 'lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb', line 40 def attributes @attributes end |
Instance Method Details
#document_selector ⇒ DocumentSelector
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.
20 21 22 |
# File 'lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb', line 20 def document_selector attributes.fetch(:documentSelector) end |
#first_trigger_character ⇒ string
A character on which formatting should be triggered, like ‘{`.
28 29 30 |
# File 'lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb', line 28 def first_trigger_character attributes.fetch(:firstTriggerCharacter) end |
#more_trigger_character ⇒ string[]
More trigger characters.
36 37 38 |
# File 'lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb', line 36 def more_trigger_character attributes.fetch(:moreTriggerCharacter) end |
#to_hash ⇒ Object
42 43 44 |
# File 'lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb', line 42 def to_hash attributes end |
#to_json(*args) ⇒ Object
46 47 48 |
# File 'lib/language_server/protocol/interface/document_on_type_formatting_registration_options.rb', line 46 def to_json(*args) to_hash.to_json(*args) end |