overlay

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyParseFunc

func EmptyParseFunc(string, *gotextdiff.TextEdit) (interface{}, bool)

Types

type Entry

type Entry struct {
	Contents string
	Version  int64
	// Custom user data attached to entry after parse() is called
	Data interface{}
}

type Overlay

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

func NewOverlay

func NewOverlay() *Overlay

func (*Overlay) Close

func (o *Overlay) Close(u uri.URI)

func (*Overlay) Current

func (o *Overlay) Current(u uri.URI) *Entry

func (*Overlay) Parsed

func (o *Overlay) Parsed(u uri.URI) *Entry

func (*Overlay) Replace

func (o *Overlay) Replace(u uri.URI, version int64, data string, parse ParseFunc, done UpdateFunc)

func (*Overlay) Update

func (o *Overlay) Update(u uri.URI, version int64, edits []gotextdiff.TextEdit, parse ParseFunc, done UpdateFunc)

type ParseFunc

type ParseFunc func(contents string, lastEdit *gotextdiff.TextEdit) (data interface{}, ok bool)

This function is used to parse the file that was just updated. It will be called for every item of a batch update. `lastEdit` may be set as the last edit made in the update.

type UpdateFunc

type UpdateFunc func(UpdateResult)

UpdateFunc will be called at the end of an update batch. Calls to this callback for each individual file are linearized under a lock. Holding this lock may be useful for batching updates, f.ex waiting until diagnostics are done before returning.

type UpdateResult

type UpdateResult struct {
	Current *Entry
	Parsed  *Entry
}

Jump to

Keyboard shortcuts

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