Help us shape the future of Go! Take the 2026 Go Developer Survey

cache

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache caches documents.

func New

func New() *Cache

New returns a document cache.

func (*Cache) Get

func (c *Cache) Get(uri protocol.DocumentURI) (*Document, error)

Get retrieves a document from the cache.

func (*Cache) GetContents

func (c *Cache) GetContents(uri protocol.DocumentURI, position protocol.Range) (string, error)

func (*Cache) GetTopLevelObject

func (c *Cache) GetTopLevelObject(filename, importedFrom string) ([]*ast.DesugaredObject, bool)

func (*Cache) Put

func (c *Cache) Put(doc *Document) error

Put adds or replaces a document in the cache.

func (*Cache) PutTopLevelObject

func (c *Cache) PutTopLevelObject(filename, importedFrom string, objects []*ast.DesugaredObject)

type Document

type Document struct {
	// From DidOpen and DidChange
	Item protocol.TextDocumentItem

	// Contains the last successfully parsed AST. If doc.err is not nil, it's out of date.
	AST                  ast.Node
	LinesChangedSinceAST map[int]bool

	// From diagnostics
	Val         string
	Err         error
	Diagnostics []protocol.Diagnostic
}

Jump to

Keyboard shortcuts

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