Class: LanguageServer::Protocol::Interface::RenameParams

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text_document:, position:, new_name:) ⇒ RenameParams

Returns a new instance of RenameParams.



5
6
7
8
9
10
11
12
13
# File 'lib/language_server/protocol/interface/rename_params.rb', line 5

def initialize(text_document:, position:, new_name:)
  @attributes = {}

  @attributes[:textDocument] = text_document
  @attributes[:position] = position
  @attributes[:newName] = new_name

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



41
42
43
# File 'lib/language_server/protocol/interface/rename_params.rb', line 41

def attributes
  @attributes
end

Instance Method Details

#new_namestring

The new name of the symbol. If the given name is not valid the request must return a [ResponseError](#ResponseError) with an appropriate message set.

Returns:

  • (string)


37
38
39
# File 'lib/language_server/protocol/interface/rename_params.rb', line 37

def new_name
  attributes.fetch(:newName)
end

#positionPosition

The position at which this request was sent.

Returns:



27
28
29
# File 'lib/language_server/protocol/interface/rename_params.rb', line 27

def position
  attributes.fetch(:position)
end

#text_documentTextDocumentIdentifier

The document to rename.



19
20
21
# File 'lib/language_server/protocol/interface/rename_params.rb', line 19

def text_document
  attributes.fetch(:textDocument)
end

#to_hashObject



43
44
45
# File 'lib/language_server/protocol/interface/rename_params.rb', line 43

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



47
48
49
# File 'lib/language_server/protocol/interface/rename_params.rb', line 47

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