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 ¶
const DefaultCommand = "scip-dotnet"
DefaultCommand is the indexer this loader drives.
const DefaultMaximumIndexTime = 20 * time.Minute
DefaultMaximumIndexTime bounds a restore and an index that will not finish.
Variables ¶
This section is empty.
Functions ¶
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.