You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When files are passed explicitly to djls check (e.g., by pre-commit), they still go through walk_files() with the is_template predicate, which filters based on FileKind — hardcoded to .html, .htm, .djhtml. A .txt or .xml template passed directly would be silently dropped.
The filtering happens in discover_files() in crates/djls/src/commands/check.rs (line ~163):
let resolved:Vec<Utf8PathBuf> = paths.iter().map(|p| { ...}).collect();returnwalk_files(&resolved, is_template, options);
The deeper analysis pipeline (check_file_with_source, check_file) doesn't care about extensions — the gate is purely at the file discovery/walk layer.
The same FileKind::Template check is also used in the LSP server (did_open, did_change, completions, diagnostics) to decide whether to activate features for a file.
Investigation needed
Should explicitly-passed files bypass the extension filter? (Probably yes — if a user passes a file, check it.)
What's the right default set of extensions for directory walking when no project config is available?
Should this be user-configurable in djls.toml / pyproject.toml?
What
When files are passed explicitly to
djls check(e.g., by pre-commit), they still go throughwalk_files()with theis_templatepredicate, which filters based onFileKind— hardcoded to.html,.htm,.djhtml. A.txtor.xmltemplate passed directly would be silently dropped.The filtering happens in
discover_files()incrates/djls/src/commands/check.rs(line ~163):The deeper analysis pipeline (
check_file_with_source,check_file) doesn't care about extensions — the gate is purely at the file discovery/walk layer.The same
FileKind::Templatecheck is also used in the LSP server (did_open,did_change, completions, diagnostics) to decide whether to activate features for a file.Investigation needed
djls.toml/pyproject.toml?TEMPLATESfrom settings could inform which extensions to treat as templates.FileKind::Template/is_templateusage sites — the LSP server uses it too.Key files
crates/djls-source/src/file.rs—FileKindenum, hardcoded extensionscrates/djls/src/commands/check.rs—discover_files(),is_template()crates/djls-server/src/server.rs— LSP feature gatingcrates/djls-templates/src/lib.rs— parser entry point guardRelated
TEMPLATESconfig would provide the authoritative answerdjls checkto filter