mod

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package mod provides core features related to go.mod file handling for use by Go editors and tools.

Copyright 2023 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Diagnostics

func Diagnostics(ctx context.Context, snapshot source.Snapshot) (map[span.URI][]*source.Diagnostic, error)

Diagnostics returns diagnostics from parsing the modules in the workspace.

func Format

func Format(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle) ([]protocol.TextEdit, error)

func Hover

func Hover(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle, position protocol.Position) (*protocol.Hover, error)

func InlayHint added in v0.12.0

func InlayHint(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle, rng protocol.Range) ([]protocol.InlayHint, error)

func LensFuncs

func LensFuncs() map[command.Command]source.LensFunc

LensFuncs returns the supported lensFuncs for go.mod files.

func ModParseDiagnostics added in v0.12.0

func ModParseDiagnostics(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle) (diagnostics []*source.Diagnostic, err error)

ModParseDiagnostics reports diagnostics from parsing the mod file.

func ModTidyDiagnostics added in v0.12.0

func ModTidyDiagnostics(ctx context.Context, snapshot source.Snapshot, fh source.FileHandle) (diagnostics []*source.Diagnostic, err error)

ModTidyDiagnostics reports diagnostics from running go mod tidy.

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 TidyDiagnostics added in v0.12.0

func TidyDiagnostics(ctx context.Context, snapshot source.Snapshot) (map[span.URI][]*source.Diagnostic, error)

Diagnostics returns diagnostics from running go mod tidy.

func UpgradeDiagnostics

func UpgradeDiagnostics(ctx context.Context, snapshot source.Snapshot) (map[span.URI][]*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[span.URI][]*source.Diagnostic, error)

VulnerabilityDiagnostics returns vulnerability diagnostics for the active modules in the workspace with known vulnerabilities.

Types

This section is empty.

Jump to

Keyboard shortcuts

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