Class: LSP::DocumentOnTypeFormattingOptions

Inherits:
LSPBase
  • Object
show all
Defined in:
lib/lsp/lsp_protocol.rb

Overview

export interface DocumentOnTypeFormattingOptions

/**
 * A character on which formatting should be triggered, like ``.
 */
firstTriggerCharacter: string;
/**
 * More trigger characters.
 */
moreTriggerCharacter?: string[];

}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ DocumentOnTypeFormattingOptions

Returns a new instance of DocumentOnTypeFormattingOptions.



2436
2437
2438
2439
# File 'lib/lsp/lsp_protocol.rb', line 2436

def initialize(initial_hash = nil)
  super
  @optional_method_names = %i[moreTriggerCharacter]
end

Instance Attribute Details

#firstTriggerCharacterObject

type: string # type: string[]



2434
2435
2436
# File 'lib/lsp/lsp_protocol.rb', line 2434

def firstTriggerCharacter
  @firstTriggerCharacter
end

#moreTriggerCharacterObject

type: string # type: string[]



2434
2435
2436
# File 'lib/lsp/lsp_protocol.rb', line 2434

def moreTriggerCharacter
  @moreTriggerCharacter
end

Instance Method Details

#from_h!(value) ⇒ Object



2441
2442
2443
2444
2445
2446
# File 'lib/lsp/lsp_protocol.rb', line 2441

def from_h!(value)
  value = {} if value.nil?
  self.firstTriggerCharacter = value['firstTriggerCharacter']
  self.moreTriggerCharacter = value['moreTriggerCharacter'].map { |val| val } unless value['moreTriggerCharacter'].nil?
  self
end