fix(linter): fix hang if a file fails to parse while using --import-plugin

This commit is contained in:
Boshen 2024-05-04 17:16:43 +08:00
parent 222030c4c5
commit b1bddacd09
No known key found for this signature in database
GPG key ID: 234DA6A7079C6801

View file

@ -232,6 +232,7 @@ impl Runtime {
}
if !messages.is_empty() {
self.ignore_path(path);
let errors = messages.into_iter().map(|m| m.error).collect();
let path = path.strip_prefix(&self.cwd).unwrap_or(path);
let diagnostics = DiagnosticService::wrap_diagnostics(path, source_text, errors);