Class: LanguageServer::Protocol::Interface::PrepareRenameResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start:, end:, range:, placeholder:, default_behavior:) ⇒ PrepareRenameResult

Returns a new instance of PrepareRenameResult.



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

def initialize(start:, end:, range:, placeholder:, default_behavior:)
  @attributes = {}

  @attributes[:start] = start
  @attributes[:end] = binding.local_variable_get(:end)
  @attributes[:range] = range
  @attributes[:placeholder] = placeholder
  @attributes[:defaultBehavior] = default_behavior

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

Instance Method Details

#default_behaviorboolean

Returns:

  • (boolean)


44
45
46
# File 'lib/language_server/protocol/interface/prepare_rename_result.rb', line 44

def default_behavior
  attributes.fetch(:defaultBehavior)
end

#endPosition

The range’s end position.

Returns:



29
30
31
# File 'lib/language_server/protocol/interface/prepare_rename_result.rb', line 29

def end
  attributes.fetch(:end)
end

#placeholderstring

Returns:

  • (string)


39
40
41
# File 'lib/language_server/protocol/interface/prepare_rename_result.rb', line 39

def placeholder
  attributes.fetch(:placeholder)
end

#rangeRange

Returns:



34
35
36
# File 'lib/language_server/protocol/interface/prepare_rename_result.rb', line 34

def range
  attributes.fetch(:range)
end

#startPosition

The range’s start position.

Returns:



21
22
23
# File 'lib/language_server/protocol/interface/prepare_rename_result.rb', line 21

def start
  attributes.fetch(:start)
end

#to_hashObject



50
51
52
# File 'lib/language_server/protocol/interface/prepare_rename_result.rb', line 50

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



54
55
56
# File 'lib/language_server/protocol/interface/prepare_rename_result.rb', line 54

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