Class: LSP::LocationLink
Overview
export interface LocationLink
/**
* Span of the origin of this link.
*
* Used as the underlined span for mouse definition hover. Defaults to the word range at
* the definition position.
*/
originSelectionRange?: Range;
/**
* The target resource identifier of this link.
*/
targetUri: DocumentUri;
/**
* 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.
*/
targetRange: Range;
/**
* 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`
*/
targetSelectionRange: Range;
Instance Attribute Summary collapse
-
#originSelectionRange ⇒ Object
type: Range # type: DocumentUri # type: Range # type: Range.
-
#targetRange ⇒ Object
type: Range # type: DocumentUri # type: Range # type: Range.
-
#targetSelectionRange ⇒ Object
type: Range # type: DocumentUri # type: Range # type: Range.
-
#targetUri ⇒ Object
type: Range # type: DocumentUri # type: Range # type: Range.
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ LocationLink
constructor
A new instance of LocationLink.
Methods inherited from LSPBase
Constructor Details
#initialize(initial_hash = nil) ⇒ LocationLink
Returns a new instance of LocationLink.
103 104 105 106 |
# File 'lib/lsp/lsp_types.rb', line 103 def initialize(initial_hash = nil) super @optional_method_names = %i[originSelectionRange] end |
Instance Attribute Details
#originSelectionRange ⇒ Object
type: Range # type: DocumentUri # type: Range # type: Range
101 102 103 |
# File 'lib/lsp/lsp_types.rb', line 101 def originSelectionRange @originSelectionRange end |
#targetRange ⇒ Object
type: Range # type: DocumentUri # type: Range # type: Range
101 102 103 |
# File 'lib/lsp/lsp_types.rb', line 101 def targetRange @targetRange end |
#targetSelectionRange ⇒ Object
type: Range # type: DocumentUri # type: Range # type: Range
101 102 103 |
# File 'lib/lsp/lsp_types.rb', line 101 def targetSelectionRange @targetSelectionRange end |
#targetUri ⇒ Object
type: Range # type: DocumentUri # type: Range # type: Range
101 102 103 |
# File 'lib/lsp/lsp_types.rb', line 101 def targetUri @targetUri end |
Instance Method Details
#from_h!(value) ⇒ Object
108 109 110 111 112 113 114 115 |
# File 'lib/lsp/lsp_types.rb', line 108 def from_h!(value) value = {} if value.nil? self.originSelectionRange = Range.new(value['originSelectionRange']) unless value['originSelectionRange'].nil? self.targetUri = value['targetUri'] # Unknown type self.targetRange = Range.new(value['targetRange']) unless value['targetRange'].nil? self.targetSelectionRange = Range.new(value['targetSelectionRange']) unless value['targetSelectionRange'].nil? self end |