Class: LSP::TextDocumentWillSaveEvent

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

Overview

export interface TextDocumentWillSaveEvent

/**
 * The document that will be saved
 */
document: TextDocument;
/**
 * The reason why save was triggered.
 */
reason: 1 | 2 | 3;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#initialize, #to_h, #to_json

Constructor Details

This class inherits a constructor from LSP::LSPBase

Instance Attribute Details

#documentObject

type: TextDocument # type: 1 | 2 | 3



1520
1521
1522
# File 'lib/lsp/lsp_types.rb', line 1520

def document
  @document
end

#reasonObject

type: TextDocument # type: 1 | 2 | 3



1520
1521
1522
# File 'lib/lsp/lsp_types.rb', line 1520

def reason
  @reason
end

Instance Method Details

#from_h!(value) ⇒ Object



1522
1523
1524
1525
1526
1527
# File 'lib/lsp/lsp_types.rb', line 1522

def from_h!(value)
  value = {} if value.nil?
  self.document = TextDocument.new(value['document']) unless value['document'].nil?
  self.reason = value['reason'] # Unknown type
  self
end