documents

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentManager

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

a synced map that manages document states

func NewDocumentManager

func NewDocumentManager() *DocumentManager

func (*DocumentManager) AddAndParse

func (dm *DocumentManager) AddAndParse(vscURI, content string) error

adds a document to the map and parses its content

func (*DocumentManager) Delete

func (dm *DocumentManager) Delete(vscURI string)

func (*DocumentManager) Get

func (dm *DocumentManager) Get(vscURI string) (*DocumentState, bool)

func (*DocumentManager) GetFromMod

func (dm *DocumentManager) GetFromMod(mod *ast.Module) (*DocumentState, bool)

type DocumentState

type DocumentState struct {
	Content      string           // the content of the document
	Uri          uri.URI          // the uri from the client
	Path         string           // the filepath as parsed from the uri
	Module       *ast.Module      // the corresponding ddp module
	NeedReparse  atomic.Bool      // whether the document needs to be reparsed
	LatestErrors []ddperror.Error // the errors from the last parsing
}

represents the state of a single document

Jump to

Keyboard shortcuts

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