Class: LSP::DocumentLink
Overview
export interface DocumentLink
/**
* The range this link applies to.
*/
range: Range;
/**
* The uri this link points to.
*/
target?: string;
/**
* The tooltip text when you hover over this link.
*
* If a tooltip is provided, is will be displayed in a string that includes instructions on how to
* trigger the link, such as `{0 (ctrl + click)`. The specific instructions vary depending on OS,
* user settings, and localization.
*
* @since 3.15.0
*/
tooltip?: string;
/**
* A data entry field that is preserved on a document link between a
* DocumentLinkRequest and a DocumentLinkResolveRequest.
*/
data?: any;
}
Instance Attribute Summary collapse
-
#data ⇒ Object
type: Range # type: string # type: string # type: any.
-
#range ⇒ Object
type: Range # type: string # type: string # type: any.
-
#target ⇒ Object
type: Range # type: string # type: string # type: any.
-
#tooltip ⇒ Object
type: Range # type: string # type: string # type: any.
Instance Method Summary collapse
- #from_h!(value) ⇒ Object
-
#initialize(initial_hash = nil) ⇒ DocumentLink
constructor
A new instance of DocumentLink.
Methods inherited from LSPBase
Constructor Details
#initialize(initial_hash = nil) ⇒ DocumentLink
Returns a new instance of DocumentLink.
1379 1380 1381 1382 |
# File 'lib/lsp/lsp_types.rb', line 1379 def initialize(initial_hash = nil) super @optional_method_names = %i[target tooltip data] end |
Instance Attribute Details
#data ⇒ Object
type: Range # type: string # type: string # type: any
1377 1378 1379 |
# File 'lib/lsp/lsp_types.rb', line 1377 def data @data end |
#range ⇒ Object
type: Range # type: string # type: string # type: any
1377 1378 1379 |
# File 'lib/lsp/lsp_types.rb', line 1377 def range @range end |
#target ⇒ Object
type: Range # type: string # type: string # type: any
1377 1378 1379 |
# File 'lib/lsp/lsp_types.rb', line 1377 def target @target end |
#tooltip ⇒ Object
type: Range # type: string # type: string # type: any
1377 1378 1379 |
# File 'lib/lsp/lsp_types.rb', line 1377 def tooltip @tooltip end |
Instance Method Details
#from_h!(value) ⇒ Object
1384 1385 1386 1387 1388 1389 1390 1391 |
# File 'lib/lsp/lsp_types.rb', line 1384 def from_h!(value) value = {} if value.nil? self.range = Range.new(value['range']) unless value['range'].nil? self.target = value['target'] self.tooltip = value['tooltip'] self.data = value['data'] self end |