lsppos

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: BSD-3-Clause 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