pub struct LanguageSupport {
pub name: &'static str,
pub display_name: &'static str,
pub extensions: &'static [&'static str],
pub filenames: &'static [&'static str],
pub filename_prefixes: &'static [&'static str],
pub tools: &'static [&'static ToolSpec],
pub conventions: &'static [&'static str],
pub vendored_dirs: &'static [&'static str],
}Expand description
Everything drep needs to know about one language.
Attributes:
name: Registry key (lowercase, e.g. “typescript”).
display_name: How the language is named to the LLM and to users.
extensions: Lowercased suffixes this language owns, including the dot.
filenames: Whole file names this language owns, for extensionless files
such as Dockerfile and Gemfile.
tools: Deterministic checkers, in the order they should run.
conventions: Language-specific guidance appended to the analysis
prompt - the part that used to be hardcoded as PEP 8.
vendored_dirs: Dependency and build directories this language creates,
never descended into. Declared here rather than in a global list
so adding a language stays a single-file change.
Fields§
§name: &'static strRegistry key (lowercase, e.g. "typescript").
display_name: &'static strHow the language is named to the LLM and to users.
extensions: &'static [&'static str]Lowercased suffixes this language owns, including the dot.
filenames: &'static [&'static str]Whole file names this language owns, for files that carry no extension at all.
Path::extension returns None for Dockerfile, Gemfile and
Rakefile, so an extension-only registry drops them before either
analysis layer sees them - the same silent pass that unregistered
.java produced, on files most repositories have. Only names a
registered language actually claims belong here: Makefile and
Jenkinsfile are deliberately absent, because no language claims them
and a name with no owner would still resolve to nothing.
Matched only when the extension lookup finds nothing, so a name here
can never shadow a language that claims the suffix.
filename_prefixes: &'static [&'static str]Stems that additionally claim their dotted variants, for families like
Dockerfile.dev.
filenames claims the exact canonical name; a stem here claims
<stem>.<anything> as well. Multi-image layouts name per-environment
Dockerfiles Dockerfile.dev, Dockerfile.prod, Dockerfile.web - an
unbounded family an exact list cannot cover, and hadolint lints the
variants the same as the canonical file. The extension lookup runs
first, so Dockerfile.ts remains TypeScript, and the variant must
carry a non-empty suffix after the dot, so Dockerfile. itself is
not claimed.
tools: &'static [&'static ToolSpec]Deterministic checkers, in the order they should run.
conventions: &'static [&'static str]Language-specific guidance appended to the analysis prompt - the part that used to be hardcoded as PEP 8.
vendored_dirs: &'static [&'static str]Dependency and build directories this language creates, never descended into. Declared here rather than in a global list so adding a language stays a single-file change.
Trait Implementations§
Source§impl Clone for LanguageSupport
impl Clone for LanguageSupport
Source§fn clone(&self) -> LanguageSupport
fn clone(&self) -> LanguageSupport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more