Class: LSP::WorkspaceEdit

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

Overview

export interface WorkspaceEdit { /** * Holds changes to existing resources. / changes?: { [uri: string]: TextEdit; }; /* * Depending on the client capability workspace.workspaceEdit.resourceOperations document changes * are either an array of TextDocumentEdits to express changes to n different text documents * where each text document edit addresses a specific version of a text document. Or it can contain * above TextDocumentEdits mixed with create, rename and delete file / folder operations. * * Whether a client supports versioned document edits is expressed via * workspace.workspaceEdit.documentChanges client capability. * * If a client neither supports documentChanges nor workspace.workspaceEdit.resourceOperations then * only plain TextEdits using the changes property are supported. */ documentChanges?: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[]; }

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ WorkspaceEdit

Returns a new instance of WorkspaceEdit.



617
618
619
620
# File 'lib/lsp/lsp_types.rb', line 617

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

Instance Attribute Details

#changesObject

type: {



612
613
614
# File 'lib/lsp/lsp_types.rb', line 612

def changes
  @changes
end

#documentChangesObject

[uri: string]: TextEdit; }



615
616
617
# File 'lib/lsp/lsp_types.rb', line 615

def documentChanges
  @documentChanges
end

Instance Method Details

#from_h!(value) ⇒ Object



622
623
624
625
626
627
# File 'lib/lsp/lsp_types.rb', line 622

def from_h!(value)
  value = {} if value.nil?
  self.changes = value['changes'] # Unknown type
  self.documentChanges = value['documentChanges'] # Unknown type
  self
end