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

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

Overview

The parameters of a [RenameRequest](#RenameRequest).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of RenameParams.



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

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

  @attributes[:textDocument] = text_document
  @attributes[:position] = position
  @attributes[:newName] = new_name
  @attributes[:workDoneToken] = work_done_token if work_done_token

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



53
54
55
# File 'lib/language_server/protocol/interface/rename_params.rb', line 53

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)


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

def new_name
  attributes.fetch(:newName)
end

#positionPosition

The position at which this request was sent.

Returns:



31
32
33
# File 'lib/language_server/protocol/interface/rename_params.rb', line 31

def position
  attributes.fetch(:position)
end

#text_documentTextDocumentIdentifier

The document to rename.



23
24
25
# File 'lib/language_server/protocol/interface/rename_params.rb', line 23

def text_document
  attributes.fetch(:textDocument)
end

#to_hashObject



55
56
57
# File 'lib/language_server/protocol/interface/rename_params.rb', line 55

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



59
60
61
# File 'lib/language_server/protocol/interface/rename_params.rb', line 59

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

#work_done_tokenProgressToken | nil

An optional token that a server can use to report work done progress.

Returns:

  • (ProgressToken | nil)


49
50
51
# File 'lib/language_server/protocol/interface/rename_params.rb', line 49

def work_done_token
  attributes.fetch(:workDoneToken)
end