mapper

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mapper

type Mapper struct {
	// contains filtered or unexported fields
}

func NewMapper

func NewMapper(fileURI uri.URI, content []byte) *Mapper

NewMapper ...

func (*Mapper) GetLSPEndPosition

func (m *Mapper) GetLSPEndPosition() types.Position

GetLSPEndPosition returns the position immediately after the last character of the document: the last line (0-based) at the UTF-16 length of its content. A document ending with a newline has an empty last line.

func (*Mapper) LSPPosToParserPosition

func (m *Mapper) LSPPosToParserPosition(pos types.Position) (syntax.Position, error)

convert from utf16-based to rune-based position

func (*Mapper) OffsetToLSPPosition

func (m *Mapper) OffsetToLSPPosition(offset int) (types.Position, error)

OffsetToLSPPosition converts a byte offset in the mapped content to an LSP position (0-based line, UTF-16 code-unit column).

Jump to

Keyboard shortcuts

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