Skip to content

Commit c0255eb

Browse files
fix diagnostics by restoring path-based FileKind detection (#265)
1 parent 86a0321 commit c0255eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/djls-server/src/server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,10 @@ impl LanguageServer for DjangoLanguageServer {
368368
));
369369
};
370370

371+
let path: Utf8PathBuf = url.path().into();
372+
371373
// Only provide diagnostics for template files
372-
let file_kind = FileKind::from(url.path());
373-
if file_kind != FileKind::Template {
374+
if FileKind::from(&path) != FileKind::Template {
374375
return Ok(lsp_types::DocumentDiagnosticReportResult::Report(
375376
lsp_types::DocumentDiagnosticReport::Full(
376377
lsp_types::RelatedFullDocumentDiagnosticReport {
@@ -385,7 +386,6 @@ impl LanguageServer for DjangoLanguageServer {
385386
}
386387

387388
// Get diagnostics from the database
388-
let path: Utf8PathBuf = url.path().into();
389389
let diagnostics: Vec<lsp_types::Diagnostic> = self
390390
.with_session_mut(|session| {
391391
let file = session.get_or_create_file(&path);

0 commit comments

Comments
 (0)