Class: LSP::CreateFile

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

Overview

export interface CreateFile extends ResourceOperation

/**
 * A create
 */
kind: 'create';
/**
 * The resource to create.
 */
uri: DocumentUri;
/**
 * Additional options
 */
options?: CreateFileOptions;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from LSPBase

#to_h, #to_json

Constructor Details

#initialize(initial_hash = nil) ⇒ CreateFile

Returns a new instance of CreateFile.



457
458
459
460
# File 'lib/lsp/lsp_types.rb', line 457

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

Instance Attribute Details

#kindObject

type: string with value ‘create’ # type: DocumentUri # type: CreateFileOptions



455
456
457
# File 'lib/lsp/lsp_types.rb', line 455

def kind
  @kind
end

#optionsObject

type: string with value ‘create’ # type: DocumentUri # type: CreateFileOptions



455
456
457
# File 'lib/lsp/lsp_types.rb', line 455

def options
  @options
end

#uriObject

type: string with value ‘create’ # type: DocumentUri # type: CreateFileOptions



455
456
457
# File 'lib/lsp/lsp_types.rb', line 455

def uri
  @uri
end

Instance Method Details

#from_h!(value) ⇒ Object



462
463
464
465
466
467
468
# File 'lib/lsp/lsp_types.rb', line 462

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