textdocument

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package textdocument is a slim wrapper around lsp.TextDocumentItem that contains useful methods such as PositionAt

See: https://github.com/microsoft/vscode-languageserver-node/blob/master/textDocument/src/main.ts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TextDocument

type TextDocument struct {
	lsp.TextDocumentItem
}

TextDocument is a struct that extends the lsp.TextDocumentItem struct with useful helper methods

func From

func From(document lsp.TextDocumentItem) TextDocument

From will turn an lsp.TextDocumentItem into a textdocument.TextDocument

func (*TextDocument) PositionAt

func (doc *TextDocument) PositionAt(offset int) lsp.Position

PositionAt will return a valid position from a given offset by calculating it relative to the line offsets of the document

Jump to

Keyboard shortcuts

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