toolchain

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 18 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 toolchain manages optional analyzers owned by a Kivgraph installation. Managed tools live in Kivgraph state, never in a repository.

Index

Constants

View Source
const (
	// Pyright is the first managed analyzer. The command family is intentionally
	// generic so future analyzers can use the same state and activation model.
	Pyright = "pyright"
	// DefaultPyrightVersion is pinned so an install does not silently change
	// the semantic provider used by a later graph generation.
	DefaultPyrightVersion = "1.1.413"
)

Variables

This section is empty.

Functions

func FindNPM

func FindNPM() (string, error)

FindNPM locates the package manager used for installing Pyright.

func IsManagedPyrightCommand

func IsManagedPyrightCommand(command, stateDirectory string) bool

IsManagedPyrightCommand reports whether command points into this installation's managed Pyright directory.

func Names

func Names() []string

Names returns the managed tool vocabulary exposed by this build.

func PyrightAnalyzerCommand

func PyrightAnalyzerCommand(executable string) string

PyrightAnalyzerCommand returns the bundled adapter command configured to launch one managed Pyright language server.

func PyrightRoot

func PyrightRoot(stateDirectory string) string

PyrightRoot returns the version-independent Pyright directory.

func Remove

func Remove(stateDirectory, name string) error

Remove deletes only the managed state for one supported analyzer.

func SplitCommandLine

func SplitCommandLine(command string) ([]string, error)

SplitCommandLine parses the small shell-like command vocabulary accepted by analyzer configuration. It removes quoting used for paths with spaces while preserving ordinary command arguments and platform path separators.

func StateRoot

func StateRoot(stateDirectory string) string

StateRoot returns the directory where managed tools belong for one installation or profile universe.

func ValidateName

func ValidateName(name string) error

ValidateName checks the generic command's tool argument.

func ValidateVersion

func ValidateVersion(version string) error

ValidateVersion accepts one exact stable semantic version, without a leading v. Keeping the path and package selector in this form avoids a floating npm range and makes the install reproducible at the command level.

Types

type Manifest

type Manifest struct {
	Schema     int    `json:"schema"`
	Name       string `json:"name"`
	Version    string `json:"version"`
	Package    string `json:"package"`
	Executable string `json:"executable"`
	SHA256     string `json:"sha256"`
}

Manifest is the durable description of an installed managed tool.

type ToolStatus

type ToolStatus struct {
	Name       string `json:"name"`
	State      string `json:"state"`
	Version    string `json:"version,omitempty"`
	Root       string `json:"root,omitempty"`
	Executable string `json:"executable,omitempty"`
	SHA256     string `json:"sha256,omitempty"`
	Detail     string `json:"detail,omitempty"`
}

ToolStatus describes one managed tool without claiming that an absent tool is an error. A broken installation is named separately from a missing one.

func Install

func Install(ctx context.Context, stateDirectory, name, version, npmPath string) (ToolStatus, error)

Install installs one supported analyzer into stateDirectory. npmPath is injectable for tests; an empty value discovers npm on PATH.

func Status

func Status(stateDirectory string) ([]ToolStatus, error)

Status returns the status of every managed analyzer in this build.

Jump to

Keyboard shortcuts

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