Documentation ¶
Overview ¶
Package mod provides core features related to go.mod file handling for use by Go editors and tools.
Index ¶
- func Diagnostics(ctx context.Context, snapshot source.Snapshot) (map[source.VersionedFileIdentity][]*source.Diagnostic, error)
- func Format(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle) ([]protocol.TextEdit, error)
- func Hover(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle, ...) (*protocol.Hover, error)
- func LensFuncs() map[command.Command]source.LensFunc
- func ModDiagnostics(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle) (diagnostics []*source.Diagnostic, err error)
- func ModUpgradeDiagnostics(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle) (upgradeDiagnostics []*source.Diagnostic, err error)
- func ModVulnerabilityDiagnostics(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle) (vulnDiagnostics []*source.Diagnostic, err error)
- func SelectUpgradeCodeActions(actions []protocol.CodeAction) []protocol.CodeAction
- func UpgradeDiagnostics(ctx context.Context, snapshot source.Snapshot) (map[source.VersionedFileIdentity][]*source.Diagnostic, error)
- func VulnerabilityDiagnostics(ctx context.Context, snapshot source.Snapshot) (map[source.VersionedFileIdentity][]*source.Diagnostic, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Diagnostics ¶
func Diagnostics(ctx context.Context, snapshot source.Snapshot) (map[source.VersionedFileIdentity][]*source.Diagnostic, error)
Diagnostics returns diagnostics for the modules in the workspace.
It waits for completion of type-checking of all active packages.
func ModDiagnostics ¶
func ModDiagnostics(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle) (diagnostics []*source.Diagnostic, err error)
ModDiagnostics waits for completion of type-checking of all active packages, then returns diagnostics from diagnosing the packages in the workspace and from tidying the go.mod file.
func ModUpgradeDiagnostics ¶
func ModUpgradeDiagnostics(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle) (upgradeDiagnostics []*source.Diagnostic, err error)
ModUpgradeDiagnostics adds upgrade quick fixes for individual modules if the upgrades are recorded in the view.
func ModVulnerabilityDiagnostics ¶
func ModVulnerabilityDiagnostics(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle) (vulnDiagnostics []*source.Diagnostic, err error)
ModVulnerabilityDiagnostics adds diagnostics for vulnerabilities in individual modules if the vulnerability is recorded in the view.
func SelectUpgradeCodeActions ¶
func SelectUpgradeCodeActions(actions []protocol.CodeAction) []protocol.CodeAction
SelectUpgradeCodeActions takes a list of code actions for a required module and returns a more selective list of upgrade code actions, where the code actions have been deduped. Code actions unrelated to upgrade are deduplicated by the name.
func UpgradeDiagnostics ¶
func UpgradeDiagnostics(ctx context.Context, snapshot source.Snapshot) (map[source.VersionedFileIdentity][]*source.Diagnostic, error)
UpgradeDiagnostics returns upgrade diagnostics for the modules in the workspace with known upgrades.
func VulnerabilityDiagnostics ¶
func VulnerabilityDiagnostics(ctx context.Context, snapshot source.Snapshot) (map[source.VersionedFileIdentity][]*source.Diagnostic, error)
VulnerabilityDiagnostics returns vulnerability diagnostics for the active modules in the workspace with known vulnerabilites.
Types ¶
This section is empty.