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

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

Overview

The parameters of a 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.

Parameters:

  • text_document: (Object)
  • position: (Object)
  • new_name: (String)
  • work_done_token: (Object) (defaults to: nil)


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

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


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 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_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


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

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


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

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

Returns:

  • (ProgressToken)


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

def work_done_token
  attributes.fetch(:workDoneToken)
end