Class: LSP::RenameFile

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

Overview

export interface RenameFile extends ResourceOperation

/**
 * A rename
 */
kind: 'rename';
/**
 * The old (existing) location.
 */
oldUri: DocumentUri;
/**
 * The new location.
 */
newUri: DocumentUri;
/**
 * Rename options.
 */
options?: RenameFileOptions;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ RenameFile

Returns a new instance of RenameFile.



518
519
520
521
# File 'lib/lsp/lsp_types.rb', line 518

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

Instance Attribute Details

#kindObject

type: string with value ‘rename’ # type: DocumentUri # type: DocumentUri # type: RenameFileOptions



516
517
518
# File 'lib/lsp/lsp_types.rb', line 516

def kind
  @kind
end

#newUriObject

type: string with value ‘rename’ # type: DocumentUri # type: DocumentUri # type: RenameFileOptions



516
517
518
# File 'lib/lsp/lsp_types.rb', line 516

def newUri
  @newUri
end

#oldUriObject

type: string with value ‘rename’ # type: DocumentUri # type: DocumentUri # type: RenameFileOptions



516
517
518
# File 'lib/lsp/lsp_types.rb', line 516

def oldUri
  @oldUri
end

#optionsObject

type: string with value ‘rename’ # type: DocumentUri # type: DocumentUri # type: RenameFileOptions



516
517
518
# File 'lib/lsp/lsp_types.rb', line 516

def options
  @options
end

Instance Method Details

#from_h!(value) ⇒ Object



523
524
525
526
527
528
529
530
# File 'lib/lsp/lsp_types.rb', line 523

def from_h!(value)
  value = {} if value.nil?
  self.kind = value['kind'] # Unknown type
  self.oldUri = value['oldUri'] # Unknown type
  self.newUri = value['newUri'] # Unknown type
  self.options = RenameFileOptions.new(value['options']) unless value['options'].nil?
  self
end