csharploader

package
v0.9.9-dev.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 15 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 csharploader turns the C# code of a registered repository into semantic facts, through the SCIP index scip-dotnet emits.

scip-dotnet drives Roslyn -- the compiler's own analysis -- over a solution or project, so its targets are resolved by the thing that would compile the code. It runs `dotnet restore` first, which is why indexing a C# repository needs the SDK and a network on the first pass.

And a restore writes `obj/` and `bin/` into the project it restores, which AGENTS.md forbids without an exception. So the repository is never the directory handed to the indexer: the loader materialises the working tree elsewhere with internal/scratchtree and throws it away afterwards. See ADR 0082.

Index

Constants

View Source
const DefaultCommand = "scip-dotnet"

DefaultCommand is the indexer this loader drives.

View Source
const DefaultMaximumIndexTime = 20 * time.Minute

DefaultMaximumIndexTime bounds a restore and an index that will not finish.

Variables

This section is empty.

Functions

func Convert

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

Convert turns a decoded index into a payload, separately from Run so a test can drive it from a recorded index without the .NET SDK.

func Run

func Run(ctx context.Context, options Options) (facts.SemanticPayload, error)

Run indexes one repository and returns its semantic payload.

Types

type Options

type Options struct {
	Command string
	// Project is the .sln or .csproj to index. Empty discovers one: a single
	// solution wins over projects, because that is what the compiler would
	// build.
	Project string
	// TargetDirectory is where the index file is written. It lives outside
	// every indexed repository, like java.target_directory.
	TargetDirectory  string
	Repository       workspace.Repository
	IncludeTests     bool
	IncludeGenerated bool
	MaximumIndexTime time.Duration
	// SkipRestore passes --skip-dotnet-restore. It is off by default: an
	// index built without a restore silently loses every symbol that comes
	// from a package, which looks like a repository with fewer dependencies
	// rather than an index that was not allowed to resolve them.
	SkipRestore bool
}

Options configures one C# facts producer.

Jump to

Keyboard shortcuts

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