Class: LanguageServer::Protocol::Interface::RenameFile

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/rename_file.rb

Overview

Rename file operation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind:, old_uri:, new_uri:, options: nil, annotation_id: nil) ⇒ RenameFile

Returns a new instance of RenameFile.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/language_server/protocol/interface/rename_file.rb', line 8

def initialize(kind:, old_uri:, new_uri:, options: nil, annotation_id: nil)
  @attributes = {}

  @attributes[:kind] = kind
  @attributes[:oldUri] = old_uri
  @attributes[:newUri] = new_uri
  @attributes[:options] = options if options
  @attributes[:annotationId] = annotation_id if annotation_id

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



62
63
64
# File 'lib/language_server/protocol/interface/rename_file.rb', line 62

def attributes
  @attributes
end

Instance Method Details

#annotation_idChangeAnnotationIdentifier | nil

An optional annotation identifier describing the operation.

Returns:

  • (ChangeAnnotationIdentifier | nil)

Since:

  • 3.16.0



58
59
60
# File 'lib/language_server/protocol/interface/rename_file.rb', line 58

def annotation_id
  attributes.fetch(:annotationId)
end

#kind"rename"

A rename

Returns:

  • ("rename")


24
25
26
# File 'lib/language_server/protocol/interface/rename_file.rb', line 24

def kind
  attributes.fetch(:kind)
end

#new_uriDocumentUri

The new location.

Returns:

  • (DocumentUri)


40
41
42
# File 'lib/language_server/protocol/interface/rename_file.rb', line 40

def new_uri
  attributes.fetch(:newUri)
end

#old_uriDocumentUri

The old (existing) location.

Returns:

  • (DocumentUri)


32
33
34
# File 'lib/language_server/protocol/interface/rename_file.rb', line 32

def old_uri
  attributes.fetch(:oldUri)
end

#optionsRenameFileOptions | nil

Rename options.

Returns:



48
49
50
# File 'lib/language_server/protocol/interface/rename_file.rb', line 48

def options
  attributes.fetch(:options)
end

#to_hashObject



64
65
66
# File 'lib/language_server/protocol/interface/rename_file.rb', line 64

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



68
69
70
# File 'lib/language_server/protocol/interface/rename_file.rb', line 68

def to_json(*args)
  to_hash.to_json(*args)
end