Skip to content

Commit 95c287a

Browse files
committed
No longer diagnose files in the lib directory.
Fix #683
1 parent d669597 commit 95c287a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/emmylua_code_analysis/src/diagnostic/lua_diagnostic.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ impl LuaDiagnostic {
4040
}
4141

4242
let db = compilation.get_db();
43+
if let Some(module_info) = db.get_module_index().get_workspace_id(file_id) {
44+
if !module_info.is_main() {
45+
return None;
46+
}
47+
}
48+
49+
4350
let mut semantic_model = compilation.get_semantic_model(file_id)?;
4451
let mut context = DiagnosticContext::new(file_id, db, self.config.clone());
4552

0 commit comments

Comments
 (0)