workspace

package
v1.1295.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unscanned types.FolderStatus = iota
	Scanned   types.FolderStatus = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Folder

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

Folder contains files that can be scanned, it orchestrates snyk scans and provides a caching layer to avoid unnecessary computing

func NewFolder

func NewFolder(
	c *config.Config,
	path string,
	name string,
	scanner scanner.Scanner,
	hoverService hover.Service,
	scanNotifier scanner.ScanNotifier,
	notifier noti.Notifier,
	scanPersister persistence.ScanSnapshotPersister,
) *Folder

func (*Folder) Clear

func (f *Folder) Clear()

func (*Folder) ClearDiagnosticsByIssueType

func (f *Folder) ClearDiagnosticsByIssueType(removedType product.FilterableIssueType)

func (*Folder) ClearIssues

func (f *Folder) ClearIssues(path string)

func (*Folder) Contains

func (f *Folder) Contains(path string) bool

func (*Folder) FilterAndPublishDiagnostics

func (f *Folder) FilterAndPublishDiagnostics(p product.Product)

func (*Folder) FilterIssues

func (f *Folder) FilterIssues(issues snyk.IssuesByFile, supportedIssueTypes map[product.FilterableIssueType]bool) snyk.IssuesByFile

func (*Folder) IsProviderFor

func (f *Folder) IsProviderFor(_ product.FilterableIssueType) bool

func (*Folder) IsScanned

func (f *Folder) IsScanned() bool

func (*Folder) IsTrusted

func (f *Folder) IsTrusted() bool

func (*Folder) Issue

func (f *Folder) Issue(key string) snyk.Issue

func (*Folder) Issues

func (f *Folder) Issues() snyk.IssuesByFile

func (*Folder) IssuesByProduct

func (f *Folder) IssuesByProduct() snyk.ProductIssuesByFile

func (*Folder) IssuesForFile

func (f *Folder) IssuesForFile(file string) []snyk.Issue

func (*Folder) IssuesForRange

func (f *Folder) IssuesForRange(filePath string, requestedRange snyk.Range) (matchingIssues []snyk.Issue)

func (*Folder) Name

func (f *Folder) Name() string

func (*Folder) Path

func (f *Folder) Path() string

func (*Folder) RegisterCacheRemovalHandler

func (f *Folder) RegisterCacheRemovalHandler(handler func(path string))

func (*Folder) ScanFile

func (f *Folder) ScanFile(ctx context.Context, path string)

func (*Folder) ScanFolder

func (f *Folder) ScanFolder(ctx context.Context)

func (*Folder) SetStatus

func (f *Folder) SetStatus(status types.FolderStatus)

func (*Folder) Status

func (f *Folder) Status() types.FolderStatus

func (*Folder) Uri

func (f *Folder) Uri() lsp.DocumentURI

type Workspace

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

Workspace represents the highest entity in an IDE that contains code. A workspace may contain multiple folders

func New

func New(
	c *config.Config,
	instrumentor performance.Instrumentor,
	scanner scanner.Scanner,
	hoverService hover.Service,
	scanNotifier scanner.ScanNotifier,
	notifier noti.Notifier,
	scanPersister persistence.ScanSnapshotPersister,
) *Workspace

func (*Workspace) AddFolder

func (w *Workspace) AddFolder(f types.Folder)

func (*Workspace) ChangeWorkspaceFolders

func (w *Workspace) ChangeWorkspaceFolders(params types.DidChangeWorkspaceFoldersParams) []types.Folder

ChangeWorkspaceFolders clears the "Removed" folders, adds the "New" folders, and starts an automatic scan if auto-scans are enabled.

func (*Workspace) Clear

func (w *Workspace) Clear()

func (*Workspace) ClearIssuesByType

func (w *Workspace) ClearIssuesByType(removedType product.FilterableIssueType)

func (*Workspace) DeleteFile

func (w *Workspace) DeleteFile(filePath string)

func (*Workspace) EndRequestTrustCommunication

func (w *Workspace) EndRequestTrustCommunication()

func (*Workspace) Folders

func (w *Workspace) Folders() (folder []types.Folder)

func (*Workspace) GetFolderContaining

func (w *Workspace) GetFolderContaining(path string) types.Folder

func (*Workspace) GetFolderTrust

func (w *Workspace) GetFolderTrust() (trusted []types.Folder, untrusted []types.Folder)

func (*Workspace) GetScanSnapshotClearerExister

func (w *Workspace) GetScanSnapshotClearerExister() types.ScanSnapshotClearerExister

func (*Workspace) IsTrustRequestOngoing

func (w *Workspace) IsTrustRequestOngoing() bool

func (*Workspace) Issue

func (w *Workspace) Issue(key string) snyk.Issue

func (*Workspace) Issues

func (w *Workspace) Issues() snyk.IssuesByFile

func (*Workspace) IssuesForFile

func (w *Workspace) IssuesForFile(path string) []snyk.Issue

func (*Workspace) IssuesForRange

func (w *Workspace) IssuesForRange(path string, r snyk.Range) []snyk.Issue

func (*Workspace) RemoveFolder

func (w *Workspace) RemoveFolder(folderPath string)

func (*Workspace) ScanWorkspace

func (w *Workspace) ScanWorkspace(ctx context.Context)

func (*Workspace) StartRequestTrustCommunication

func (w *Workspace) StartRequestTrustCommunication()

func (*Workspace) TrustFoldersAndScan

func (w *Workspace) TrustFoldersAndScan(ctx context.Context, foldersToBeTrusted []types.Folder)

Jump to

Keyboard shortcuts

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