scip

package
v0.9.8-dev.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 8 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 scip turns a SCIP index into the semantic payload every external language producer shares.

SCIP is one format with many producers -- scip-java, scip-python, scip-ruby, scip-dotnet, scip-clang, and `rust-analyzer scip` -- so the conversion is written once here rather than once per language. What a language still owns is running its indexer and naming its package; what it does not own is the graph model, which is facts.NormalizeSemantic's.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(index scipwire.Index, options Options) (facts.SemanticPayload, error)

Convert turns one SCIP index into one semantic payload.

The shape it produces is the one facts.NormalizeSemantic consumes: files, symbols with a full declaration range, references attributed to the symbol that encloses them, and an unresolved row for every target this repository does not declare.

Types

type Options

type Options struct {
	// Language stamps every fact. It decides the provenance and the stable
	// key namespace, so it is required.
	Language facts.Language
	// Repository is the registered repository name the payload belongs to.
	Repository string
	// Package names the unit the symbols belong to. Empty falls back to the
	// repository name, which is what facts.NormalizeSemantic would do anyway.
	Package      string
	PackageRoot  string
	ManifestPath string
	// Analyzer and AnalyzerVersion identify the producer. They default to
	// the index's own metadata, which is what a producer writes there.
	Analyzer        string
	AnalyzerVersion string
	// Authoritative marks the references as type-checked. It is a statement
	// about the producer, not about SCIP: an index emitted by a syntax-only
	// tool is still a valid SCIP index and its edges are still candidates.
	Authoritative bool
	// ReadFile returns the bytes of a repository-relative path, for
	// converting the index's line/character positions into byte offsets. A
	// nil reader leaves offsets at zero, which is honest but costs every
	// consumer that ranks by position.
	ReadFile func(relativePath string) ([]byte, error)
	// IncludeFile decides whether a document enters the payload. A nil
	// filter includes every document the index carries.
	IncludeFile func(relativePath string) bool
	// Generated reports whether a document is generated code.
	Generated func(relativePath string) bool
	// LocalPackages are the SCIP package identities that belong to this
	// payload's repository. An occurrence of a symbol outside them is a
	// reference to something this repository does not declare, and becomes
	// an unresolved fact rather than an invented local symbol.
	LocalPackages map[string]bool
}

Options is what the conversion cannot infer from the index itself.

Directories

Path Synopsis
Package scipwire decodes the subset of the SCIP index format Kivgraph reads from `rust-analyzer scip`.
Package scipwire decodes the subset of the SCIP index format Kivgraph reads from `rust-analyzer scip`.

Jump to

Keyboard shortcuts

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