cache

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateCacheForURIFromDisk

func UpdateCacheForURIFromDisk(cache *Cache, fileURI, path string) (bool, 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) ClearIgnoredFileContents added in v0.24.0

func (c *Cache) ClearIgnoredFileContents(fileURI string)

func (*Cache) Delete

func (c *Cache) Delete(fileURI string)

Delete removes all cached data for a given URI. Ignored file contents are also removed if found for a matching URI.

func (*Cache) GetAggregateDiagnostics

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

func (*Cache) GetAllBuiltInPositions

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

func (*Cache) GetAllDiagnosticsForURI

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

func (*Cache) GetAllFileRefs added in v0.23.0

func (c *Cache) GetAllFileRefs() map[string]map[string]types.Ref

func (*Cache) GetAllFiles

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

func (*Cache) GetAllIgnoredFiles added in v0.24.0

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

func (*Cache) GetAllModules

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

func (*Cache) GetBuiltinPositions

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

func (*Cache) GetFileContents

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

func (*Cache) GetFileDiagnostics

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

func (*Cache) GetFileRefs added in v0.23.0

func (c *Cache) GetFileRefs(fileURI string) map[string]types.Ref

func (*Cache) GetIgnoredFileContents added in v0.24.0

func (c *Cache) GetIgnoredFileContents(fileURI string) (string, bool)

func (*Cache) GetKeywordLocations added in v0.24.0

func (c *Cache) GetKeywordLocations(fileURI string) (map[uint][]types.KeywordLocation, bool)

func (*Cache) GetModule

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

func (*Cache) GetParseErrors

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

func (*Cache) SetAggregateDiagnostics

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

func (*Cache) SetBuiltinPositions

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

func (*Cache) SetFileContents

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

func (*Cache) SetFileDiagnostics

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

func (*Cache) SetFileRefs added in v0.23.0

func (c *Cache) SetFileRefs(fileURI string, items map[string]types.Ref)

func (*Cache) SetIgnoredFileContents added in v0.24.0

func (c *Cache) SetIgnoredFileContents(fileURI string, content string)

func (*Cache) SetKeywordLocations added in v0.24.0

func (c *Cache) SetKeywordLocations(fileURI string, keywords map[uint][]types.KeywordLocation)

func (*Cache) SetModule

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

func (*Cache) SetParseErrors

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

Jump to

Keyboard shortcuts

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