lsppos

package
v0.0.0-...-f39ad0c Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package lsppos provides utilities for working with LSP positions.

See https://microsoft.github.io/language-server-protocol/specification#textDocuments for a description of LSP positions. Notably:

  • Positions are specified by a 0-based line count and 0-based utf-16 character offset.
  • Positions are line-ending agnostic: there is no way to specify \r|\n or \n|. Instead the former maps to the end of the current line, and the latter to the start of the next line.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UTF16len

func UTF16len(buf []byte) int

Types

type Mapper

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

func NewMapper

func NewMapper(src []byte) *Mapper

func (*Mapper) Position

func (m *Mapper) Position(offset int) (line, char int)

Jump to

Keyboard shortcuts

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