internal: Compute syntax validation errors on demand

This commit is contained in:
Lukas Wirth 2024-03-04 11:39:38 +01:00
parent 4303e741de
commit c3c9f5ffe1
11 changed files with 45 additions and 44 deletions

View file

@ -299,7 +299,7 @@ pub fn diagnostics(
let mut res = Vec::new();
// [#34344] Only take first 128 errors to prevent slowing down editor/ide, the number 128 is chosen arbitrarily.
res.extend(parse.errors().iter().take(128).map(|err| {
res.extend(parse.errors().into_iter().take(128).map(|err| {
Diagnostic::new(
DiagnosticCode::RustcHardError("syntax-error"),
format!("Syntax Error: {err}"),