file

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL