Documentation
¶
Overview ¶
Package dartloader turns the Dart code of a registered repository into semantic facts by driving the Dart analysis server.
Index ¶
- Constants
- func ExternalPackageRepositories(root, configured string) []workspace.Repository
- func PackageRoots(root, configured string) []string
- func Run(ctx context.Context, command, sdkPath string, repository workspace.Repository, ...) (facts.SemanticPayload, error)
- func RunWithOptions(ctx context.Context, options Options) (facts.SemanticPayload, error)
- func RunWithRepositories(ctx context.Context, command, sdkPath string, repository workspace.Repository, ...) (facts.SemanticPayload, error)
- func SDKRoot(command string) (string, error)
- type Options
Constants ¶
const PayloadVersion = 1
Variables ¶
This section is empty.
Functions ¶
func ExternalPackageRepositories ¶
func ExternalPackageRepositories(root, configured string) []workspace.Repository
ExternalPackageRepositories turns the package roots resolved by Pub into explicit providers. They are only returned when the caller opts in; the main repository remains the only default unit and package-cache source is never silently added to a graph.
func PackageRoots ¶ added in v0.10.0
PackageRoots lists the roots of the packages a repository's package config names, other than the repository itself, that exist on disk. The analysis server reads the files of every one of them whether or not the loader publishes their symbols, so they are what a repository can depend on besides its own sources.
func Run ¶
func Run(ctx context.Context, command, sdkPath string, repository workspace.Repository, includeGenerated, includeTests bool) (facts.SemanticPayload, error)
Run indexes a Dart project through the SDK's LSP Analysis Server. The server supplies declarations and resolved references; Kivgraph only uses source text to classify an already-resolved occurrence as a call.
func RunWithOptions ¶
RunWithOptions is the configurable Dart entry point used by the full indexer. The Analysis Server owns semantic resolution; this package only translates its results into the versioned Kivgraph payload.
func RunWithRepositories ¶
func RunWithRepositories(ctx context.Context, command, sdkPath string, repository workspace.Repository, includeGenerated, includeTests bool, providers []workspace.Repository) (facts.SemanticPayload, error)
RunWithRepositories is Run with the registered repository roots available for provider identity mapping. The loader still publishes only the consumer repository's files; provider files are read only to identify an analyzer target that crosses a registered repository boundary.
Types ¶
type Options ¶
type Options struct {
Command string
SDKPath string
Repository workspace.Repository
IncludeGenerated bool
IncludeTests bool
IncludeExternal bool
IncludeSDK bool
PackageConfig string
WaitForAnalysis bool
MaximumAnalysisTime time.Duration
Providers []workspace.Repository
}
Options controls one authoritative Dart analysis pass. The defaults preserve the historical loader behaviour, while the additional switches make package configuration and bounded analysis explicit to callers.