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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of PrepareRenameResult.

Parameters:

  • start: (Object) (defaults to: nil)
  • end: (Object) (defaults to: nil)
  • range: (Object) (defaults to: nil)
  • placeholder: (String) (defaults to: nil)
  • default_behavior: (Boolean) (defaults to: nil)


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: nil, end: nil, range: nil, placeholder: nil, default_behavior: nil)
  @attributes = {}

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

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


57
58
59
# File 'lib/language_server/protocol/interface/prepare_rename_result.rb', line 57

def attributes
  @attributes
end

Instance Method Details

#default_behaviorboolean

Returns:

  • (boolean)


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

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)


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

def placeholder
  attributes.fetch(:placeholder)
end

#rangeRange

Returns:



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

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

Returns:

  • (Hash[Symbol, untyped])


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

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


63
64
65
# File 'lib/language_server/protocol/interface/prepare_rename_result.rb', line 63

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