pub trait Guest {
Show 16 methods
// Required methods
fn extensions() -> Vec<String>;
fn known_dialects() -> Vec<String>;
fn lower(
path: String,
text: String,
dialect: Option<String>,
) -> Result<FileModel, LowerError>;
fn flagged_line_rules() -> Vec<String>;
fn manifest_paths(repository_paths: Vec<String>) -> Vec<String>;
fn analyze_manifests(manifests: Vec<Manifest>) -> ManifestAnalysis;
fn resolve_imports(
repository_paths: Vec<String>,
manifests: Vec<Manifest>,
requests: Vec<ImportRequest>,
package_profiles: Vec<PackageFrameworkProfiles>,
) -> Vec<Resolution>;
fn entry_points(
repository_paths: Vec<String>,
manifests: Vec<Manifest>,
) -> Vec<String>;
fn reference_ranges() -> Vec<ReferenceRange>;
fn known_framework_profiles() -> Vec<String>;
fn resolve_framework_profiles(
package_root: String,
files: Vec<String>,
manifests: Vec<Manifest>,
selection: FrameworkProfileSelection,
) -> Result<FrameworkProfileResult, String>;
fn has_hazard_rules() -> bool;
fn hazard_rules() -> Vec<String>;
fn has_imports() -> bool;
fn has_scope_analysis() -> bool;
fn analyze_scope(
package_root: String,
dialect: Option<String>,
artifacts: Vec<FileScopeArtifact>,
) -> ScopeAnalysis;
}Required Methods§
Sourcefn extensions() -> Vec<String>
fn extensions() -> Vec<String>
The file extensions the Language plugin reads, each without its leading dot, such as ts.
Sourcefn known_dialects() -> Vec<String>
fn known_dialects() -> Vec<String>
The stable names of Dialects this Language plugin accepts in lower, such as postgresql or sqlite.
Empty when the Language plugin has no selectable Dialects.
Sourcefn lower(
path: String,
text: String,
dialect: Option<String>,
) -> Result<FileModel, LowerError>
fn lower( path: String, text: String, dialect: Option<String>, ) -> Result<FileModel, LowerError>
Lowers one file into its Code model.
path is relative to the repository root and uses forward slashes.
text is the whole file.
dialect is an optional Dialect name from known-dialects, or none for the plugin’s default Dialect.
Sourcefn flagged_line_rules() -> Vec<String>
fn flagged_line_rules() -> Vec<String>
The stable names of the Flagged line rules this Language plugin may emit.
Sourcefn manifest_paths(repository_paths: Vec<String>) -> Vec<String>
fn manifest_paths(repository_paths: Vec<String>) -> Vec<String>
Chooses the files of one repository snapshot that the host reads once and passes to analyze-manifests, resolve-imports, and entry-points, because a Plugin cannot read files.
repository-paths lists every file of the snapshot, relative to the root, with forward slashes.
The result names only paths from repository-paths, such as each package.json and tsconfig.json file.
Sourcefn analyze_manifests(manifests: Vec<Manifest>) -> ManifestAnalysis
fn analyze_manifests(manifests: Vec<Manifest>) -> ManifestAnalysis
Analyzes the selected manifests in a single pass to discover workspace packages, skipped invalid manifests, dependency ownership, declared dependencies, manifest-used dependencies, and root-dependency inheritance.
manifests holds each file that manifest-paths chose, with its text.
Sourcefn resolve_imports(
repository_paths: Vec<String>,
manifests: Vec<Manifest>,
requests: Vec<ImportRequest>,
package_profiles: Vec<PackageFrameworkProfiles>,
) -> Vec<Resolution>
fn resolve_imports( repository_paths: Vec<String>, manifests: Vec<Manifest>, requests: Vec<ImportRequest>, package_profiles: Vec<PackageFrameworkProfiles>, ) -> Vec<Resolution>
Resolves runtime imports against the files of one repository snapshot.
repository-paths lists every file of the snapshot, relative to the root, with forward slashes.
manifests holds each file that manifest-paths chose, with its text.
requests lists the runtime imports to resolve.
package-profiles lists the active Framework profile names per Workspace package, so monorepos resolve imports in one pass.
The result holds one resolution per request, in request order.
Sourcefn entry_points(
repository_paths: Vec<String>,
manifests: Vec<Manifest>,
) -> Vec<String>
fn entry_points( repository_paths: Vec<String>, manifests: Vec<Manifest>, ) -> Vec<String>
Discovers standard entry-point source files from the repository paths and selected manifests.
repository-paths lists every file of the snapshot, relative to the root, with forward slashes.
manifests holds each file that manifest-paths chose, with its text.
Every returned path must come from repository-paths.
Sourcefn reference_ranges() -> Vec<ReferenceRange>
fn reference_ranges() -> Vec<ReferenceRange>
The Reference ranges measured in the language of this Language plugin, at most one per Metric. A Metric without an entry has no published Reference range for this language. codeint shows a range only next to values that this Language plugin measured.
Sourcefn known_framework_profiles() -> Vec<String>
fn known_framework_profiles() -> Vec<String>
The stable names of the Framework profiles this Language plugin knows. Empty when the Language plugin defines no Framework profiles.
Sourcefn resolve_framework_profiles(
package_root: String,
files: Vec<String>,
manifests: Vec<Manifest>,
selection: FrameworkProfileSelection,
) -> Result<FrameworkProfileResult, String>
fn resolve_framework_profiles( package_root: String, files: Vec<String>, manifests: Vec<Manifest>, selection: FrameworkProfileSelection, ) -> Result<FrameworkProfileResult, String>
Resolves active Framework profiles and package-level conventions for one Workspace package.
package-root is the package root folder relative to the repository root, with forward slashes, or empty for the repository root.
files lists the repository-relative file paths belonging to this Workspace package, with forward slashes.
manifests holds the manifests relevant to this Workspace package, with their text.
selection chooses automatic detection or an explicit per-package override.
Sourcefn has_hazard_rules() -> bool
fn has_hazard_rules() -> bool
Whether this Language plugin defines Hazard line rules. When false, the Hazards Metric is absent for this language rather than 0.
Sourcefn hazard_rules() -> Vec<String>
fn hazard_rules() -> Vec<String>
The stable names of the Hazard line rules this Language plugin may emit.
Empty when has-hazard-rules returns false.
Sourcefn has_imports() -> bool
fn has_imports() -> bool
Whether this language has runtime imports, manifests, and entry points.
When false, codeint never calls manifest-paths, analyze-manifests, resolve-imports,
or entry-points, and import Metrics are absent for this language.
Sourcefn has_scope_analysis() -> bool
fn has_scope_analysis() -> bool
Whether this Language plugin performs cross-file scope analysis over opaque scope-artifact bytes.
Sourcefn analyze_scope(
package_root: String,
dialect: Option<String>,
artifacts: Vec<FileScopeArtifact>,
) -> ScopeAnalysis
fn analyze_scope( package_root: String, dialect: Option<String>, artifacts: Vec<FileScopeArtifact>, ) -> ScopeAnalysis
Runs cross-file scope analysis over one (package-root, dialect) group of lowered files.
package-root is the package root folder relative to the repository root, with forward slashes, or empty for the repository root.
dialect is the optional Dialect name active for this group.
artifacts holds each file’s path, settled Source set, and opaque artifact bytes from lower.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".