Class: LSP::Position
Overview
export interface Position
/**
* Line position in a document (zero-based).
* If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document.
* If a line number is negative, it defaults to 0.
*/
line: number;
/**
* Character offset on a line in a document (zero-based). Assuming that the line is
* represented as a string, the `character` value represents the gap between the
* `character` and `character + 1`.
*
* If the character value is greater than the line length it defaults back to the
* line length.
* If a line number is negative, it defaults to 0.
*/
character: number;
Instance Attribute Summary collapse
-
#character ⇒ Object
type: number # type: number.
-
#line ⇒ Object
type: number # type: number.
Instance Method Summary collapse
Methods inherited from LSPBase
Constructor Details
This class inherits a constructor from LSP::LSPBase
Instance Attribute Details
#character ⇒ Object
type: number # type: number
30 31 32 |
# File 'lib/lsp/lsp_types.rb', line 30 def character @character end |
#line ⇒ Object
type: number # type: number
30 31 32 |
# File 'lib/lsp/lsp_types.rb', line 30 def line @line end |
Instance Method Details
#from_h!(value) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/lsp/lsp_types.rb', line 32 def from_h!(value) value = {} if value.nil? self.line = value['line'] self.character = value['character'] self end |