mod

package
v0.0.0-...-395a15b Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: BSD-3-Clause Imports: 22 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 CodeLensSources

func CodeLensSources() map[settings.CodeLensSource]cache.CodeLensSourceFunc

CodeLensSources returns the sources of code lenses for go.mod files.

func Format

func Format(ctx context.Context, snapshot *cache.Snapshot, fh file.Handle) ([]protocol.TextEdit, error)

func Hover

func Hover(ctx context.Context, snapshot *cache.Snapshot, fh file.Handle, position protocol.Position) (*protocol.Hover, error)

func InlayHint

func InlayHint(ctx context.Context, snapshot *cache.Snapshot, fh file.Handle, _ protocol.Range) ([]protocol.InlayHint, error)

func ParseDiagnostics

func ParseDiagnostics(ctx context.Context, snapshot *cache.Snapshot) (map[protocol.DocumentURI][]*cache.Diagnostic, error)

ParseDiagnostics returns diagnostics from parsing the go.mod files in the workspace.

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

func TidyDiagnostics(ctx context.Context, snapshot *cache.Snapshot) (map[protocol.DocumentURI][]*cache.Diagnostic, error)

Diagnostics returns diagnostics from running go mod tidy.

func UpgradeDiagnostics

func UpgradeDiagnostics(ctx context.Context, snapshot *cache.Snapshot) (map[protocol.DocumentURI][]*cache.Diagnostic, error)

UpgradeDiagnostics returns upgrade diagnostics for the modules in the workspace with known upgrades.

func VulnerabilityDiagnostics

func VulnerabilityDiagnostics(ctx context.Context, snapshot *cache.Snapshot) (map[protocol.DocumentURI][]*cache.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