class LanguageServer::Protocol::Interface::LocationLink

Attributes

attributes[R]

Public Class Methods

new(origin_selection_range: nil, target_uri:, target_range:, target_selection_range:) click to toggle source
# File lib/language_server/protocol/interface/location_link.rb, line 5
def initialize(origin_selection_range: nil, target_uri:, target_range:, target_selection_range:)
  @attributes = {}

  @attributes[:originSelectionRange] = origin_selection_range if origin_selection_range
  @attributes[:targetUri] = target_uri
  @attributes[:targetRange] = target_range
  @attributes[:targetSelectionRange] = target_selection_range

  @attributes.freeze
end

Public Instance Methods

origin_selection_range() click to toggle source

Span of the origin of this link.

Used as the underlined span for mouse interaction. Defaults to the word range at the mouse position.

@return [Range]

# File lib/language_server/protocol/interface/location_link.rb, line 23
def origin_selection_range
  attributes.fetch(:originSelectionRange)
end
target_range() click to toggle source

The full target range of this link. If the target for example is a symbol then target range is the range enclosing this symbol not including leading/trailing whitespace but everything else like comments. This information is typically used to highlight the range in the editor.

@return [Range]

# File lib/language_server/protocol/interface/location_link.rb, line 42
def target_range
  attributes.fetch(:targetRange)
end
target_selection_range() click to toggle source

The range that should be selected and revealed when this link is being followed, e.g the name of a function. Must be contained by the the `targetRange`. See also `DocumentSymbol#range`

@return [Range]

# File lib/language_server/protocol/interface/location_link.rb, line 52
def target_selection_range
  attributes.fetch(:targetSelectionRange)
end
target_uri() click to toggle source

The target resource identifier of this link.

@return [string]

# File lib/language_server/protocol/interface/location_link.rb, line 31
def target_uri
  attributes.fetch(:targetUri)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/location_link.rb, line 58
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/location_link.rb, line 62
def to_json(*args)
  to_hash.to_json(*args)
end