Documentation
¶
Index ¶
- type TextDocument
- func (f TextDocument) Bytes() []byte
- func (f TextDocument) FindPrevious(c string, pos protocol.Position) int
- func (f TextDocument) GetLine(line uint32) string
- func (f TextDocument) LineOffset(line int) int
- func (f TextDocument) OffsetPosition(offset int) protocol.Position
- func (f TextDocument) PositionOffset(pos protocol.Position) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TextDocument ¶
type TextDocument string
TextDocument provides operations on a string representing the contents of a file.
func (TextDocument) Bytes ¶
func (f TextDocument) Bytes() []byte
func (TextDocument) FindPrevious ¶
func (f TextDocument) FindPrevious(c string, pos protocol.Position) int
FindPrevious finds the first position to the left of `pos` which contains any of the characters in `c`
func (TextDocument) GetLine ¶
func (f TextDocument) GetLine(line uint32) string
GetLine returns the string corresponding to the given line in the text.
func (TextDocument) LineOffset ¶
func (f TextDocument) LineOffset(line int) int
LineOffset returns the offset corresponding to the first character of the given line.
func (TextDocument) OffsetPosition ¶
func (f TextDocument) OffsetPosition(offset int) protocol.Position
OffsetPosition returns the position in the file corresponding to the given offset.
func (TextDocument) PositionOffset ¶
func (f TextDocument) PositionOffset(pos protocol.Position) int
PositionOffset returns the offset corresponding to the given position.
Click to show internal directories.
Click to hide internal directories.