mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Show fewer syntax errors
This commit is contained in:
parent
4c08fc9be3
commit
0908318171
1 changed files with 2 additions and 2 deletions
|
@ -35,8 +35,8 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic>
|
|||
let parse = db.parse(file_id);
|
||||
let mut res = Vec::new();
|
||||
|
||||
// [#34344] Only take first 500 errors to prevent slowing down editor/ide, the number 500 is chosen arbitrarily.
|
||||
res.extend(parse.errors().iter().take(500).map(|err| Diagnostic {
|
||||
// [#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| Diagnostic {
|
||||
range: err.range(),
|
||||
message: format!("Syntax Error: {}", err),
|
||||
severity: Severity::Error,
|
||||
|
|
Loading…
Reference in a new issue