workspace

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package workspace holds the checks made of a workspace as a whole rather than of one document: how the documents it holds fit together, which no document's own analysis sees. Each finding is a diagnostic attached to the document it is best acted on in, reported once per workspace.

Index

Constants

View Source
const CodeLibraryDeclaredTwice = "library-declared-twice"

CodeLibraryDeclaredTwice is the code of the warning that two documents in the workspace declare the same library package.

View Source
const Source = "workspace"

Source is the Source every finding of this package carries.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finding

type Finding struct {
	// Document is the document the diagnostic is reported in: the one holding
	// the declaration references do not resolve to, where removing or renaming
	// it resolves the finding. Its span lies in that document's text.
	Document string
	// Library reports whether Document is a library document (bundled, or
	// loaded from the library path) rather than one of the workspace's own,
	// whose text the workspace does not hold.
	Library bool
	// Used is the document whose declarations references resolve to.
	Used string
	// Packages are the duplicated library packages, sorted.
	Packages   []string
	Diagnostic diag.Diagnostic
}

Finding is one workspace-level diagnostic.

func DuplicateLibraries

func DuplicateLibraries(idx *symbols.Index) []Finding

DuplicateLibraries reports the library packages the index holds more than one declaration of. Two documents declaring the same `library package` — two copies of the standard library under the workspace folder or the library path, or a user library vendored twice — leave every reference to it resolving to one copy (the first the index registered) with the other silently unused. The findings are grouped by the pair of trees the copies lie in, so two copies of the whole standard library are one warning, not one per file.

Jump to

Keyboard shortcuts

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