Documentation ¶
Index ¶
- func UpdateCacheForURIFromDisk(cache *Cache, fileURI, path string) (bool, string, error)
- type Cache
- func (c *Cache) ClearFileDiagnostics()
- func (c *Cache) ClearIgnoredFileContents(fileURI string)
- func (c *Cache) Delete(fileURI string)
- func (c *Cache) GetAllBuiltInPositions() map[string]map[uint][]types.BuiltinPosition
- func (c *Cache) GetAllFileRefs() map[string]map[string]types.Ref
- func (c *Cache) GetAllFiles() map[string]string
- func (c *Cache) GetAllIgnoredFiles() map[string]string
- func (c *Cache) GetAllModules() map[string]*ast.Module
- func (c *Cache) GetBuiltinPositions(fileURI string) (map[uint][]types.BuiltinPosition, bool)
- func (c *Cache) GetFileAggregates(fileURIs ...string) map[string][]report.Aggregate
- func (c *Cache) GetFileContents(fileURI string) (string, bool)
- func (c *Cache) GetFileDiagnostics(uri string) ([]types.Diagnostic, bool)
- func (c *Cache) GetFileRefs(fileURI string) map[string]types.Ref
- func (c *Cache) GetIgnoredFileContents(fileURI string) (string, bool)
- func (c *Cache) GetKeywordLocations(fileURI string) (map[uint][]types.KeywordLocation, bool)
- func (c *Cache) GetModule(fileURI string) (*ast.Module, bool)
- func (c *Cache) GetParseErrors(uri string) ([]types.Diagnostic, bool)
- func (c *Cache) SetAggregates(data map[string][]report.Aggregate)
- func (c *Cache) SetBuiltinPositions(fileURI string, positions map[uint][]types.BuiltinPosition)
- func (c *Cache) SetFileAggregates(fileURI string, data map[string][]report.Aggregate)
- func (c *Cache) SetFileContents(fileURI string, content string)
- func (c *Cache) SetFileDiagnostics(fileURI string, diags []types.Diagnostic)
- func (c *Cache) SetFileDiagnosticsForRules(fileURI string, rules []string, diags []types.Diagnostic)
- func (c *Cache) SetFileRefs(fileURI string, items map[string]types.Ref)
- func (c *Cache) SetIgnoredFileContents(fileURI string, content string)
- func (c *Cache) SetKeywordLocations(fileURI string, keywords map[uint][]types.KeywordLocation)
- func (c *Cache) SetModule(fileURI string, module *ast.Module)
- func (c *Cache) SetParseErrors(fileURI string, diags []types.Diagnostic)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (*Cache) ClearFileDiagnostics ¶
func (c *Cache) ClearFileDiagnostics()
func (*Cache) ClearIgnoredFileContents ¶ added in v0.24.0
func (*Cache) Delete ¶
Delete removes all cached data for a given URI. Ignored file contents are also removed if found for a matching URI.
func (*Cache) GetAllBuiltInPositions ¶
func (c *Cache) GetAllBuiltInPositions() map[string]map[uint][]types.BuiltinPosition
func (*Cache) GetAllFileRefs ¶ added in v0.23.0
func (*Cache) GetAllFiles ¶
func (*Cache) GetAllIgnoredFiles ¶ added in v0.24.0
func (*Cache) GetBuiltinPositions ¶
func (*Cache) GetFileAggregates ¶ added in v0.28.0
GetFileAggregates is used to get aggregate data for a given list of files. This is only used in tests to validate the cache state.
func (*Cache) GetFileDiagnostics ¶
func (c *Cache) GetFileDiagnostics(uri string) ([]types.Diagnostic, bool)
func (*Cache) GetFileRefs ¶ added in v0.23.0
func (*Cache) GetIgnoredFileContents ¶ added in v0.24.0
func (*Cache) GetKeywordLocations ¶ added in v0.24.0
func (*Cache) GetParseErrors ¶
func (c *Cache) GetParseErrors(uri string) ([]types.Diagnostic, bool)
func (*Cache) SetAggregates ¶ added in v0.28.0
func (*Cache) SetBuiltinPositions ¶
func (c *Cache) SetBuiltinPositions(fileURI string, positions map[uint][]types.BuiltinPosition)
func (*Cache) SetFileAggregates ¶ added in v0.28.0
SetFileAggregates will only set aggregate data for the provided URI. Even if data for other files is provided, only the specified URI is updated.
func (*Cache) SetFileContents ¶
func (*Cache) SetFileDiagnostics ¶
func (c *Cache) SetFileDiagnostics(fileURI string, diags []types.Diagnostic)
func (*Cache) SetFileDiagnosticsForRules ¶ added in v0.28.0
func (c *Cache) SetFileDiagnosticsForRules(fileURI string, rules []string, diags []types.Diagnostic)
SetFileDiagnosticsForRules will perform a partial update of the diagnostics for a file given a list of evaluated rules.
func (*Cache) SetFileRefs ¶ added in v0.23.0
func (*Cache) SetIgnoredFileContents ¶ added in v0.24.0
func (*Cache) SetKeywordLocations ¶ added in v0.24.0
func (c *Cache) SetKeywordLocations(fileURI string, keywords map[uint][]types.KeywordLocation)
func (*Cache) SetParseErrors ¶
func (c *Cache) SetParseErrors(fileURI string, diags []types.Diagnostic)