cache

package
v0.22.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateCacheForURIFromDisk

func UpdateCacheForURIFromDisk(cache *Cache, uri, path string) (string, error)

Types

type Cache

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

Cache is used to store: current file contents (which includes unsaved changes), the latest parsed modules, and diagnostics for each file (including diagnostics gathered from linting files alongside other files).

func NewCache

func NewCache() *Cache

func (*Cache) ClearAggregateDiagnostics

func (c *Cache) ClearAggregateDiagnostics()

func (*Cache) ClearFileDiagnostics

func (c *Cache) ClearFileDiagnostics()

func (*Cache) Delete

func (c *Cache) Delete(uri string)

Delete removes all cached data for a given URI.

func (*Cache) GetAggregateDiagnostics

func (c *Cache) GetAggregateDiagnostics(uri string) ([]types.Diagnostic, bool)

func (*Cache) GetAllBuiltInPositions

func (c *Cache) GetAllBuiltInPositions() map[string]map[uint][]types.BuiltinPosition

func (*Cache) GetAllDiagnosticsForURI

func (c *Cache) GetAllDiagnosticsForURI(uri string) []types.Diagnostic

func (*Cache) GetAllFiles

func (c *Cache) GetAllFiles() map[string]string

func (*Cache) GetAllModules

func (c *Cache) GetAllModules() map[string]*ast.Module

func (*Cache) GetBuiltinPositions

func (c *Cache) GetBuiltinPositions(uri string) (map[uint][]types.BuiltinPosition, bool)

func (*Cache) GetFileContents

func (c *Cache) GetFileContents(uri string) (string, bool)

func (*Cache) GetFileDiagnostics

func (c *Cache) GetFileDiagnostics(uri string) ([]types.Diagnostic, bool)

func (*Cache) GetModule

func (c *Cache) GetModule(uri string) (*ast.Module, bool)

func (*Cache) GetParseErrors

func (c *Cache) GetParseErrors(uri string) ([]types.Diagnostic, bool)

func (*Cache) SetAggregateDiagnostics

func (c *Cache) SetAggregateDiagnostics(uri string, diags []types.Diagnostic)

func (*Cache) SetBuiltinPositions

func (c *Cache) SetBuiltinPositions(uri string, positions map[uint][]types.BuiltinPosition)

func (*Cache) SetFileContents

func (c *Cache) SetFileContents(uri string, content string)

func (*Cache) SetFileDiagnostics

func (c *Cache) SetFileDiagnostics(uri string, diags []types.Diagnostic)

func (*Cache) SetModule

func (c *Cache) SetModule(uri string, module *ast.Module)

func (*Cache) SetParseErrors

func (c *Cache) SetParseErrors(uri string, diags []types.Diagnostic)

Jump to

Keyboard shortcuts

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