5395: Show fewer syntax errors r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-07-15 14:06:28 +00:00 committed by GitHub
commit 57652fc9d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,8 +35,8 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic>
let parse = db.parse(file_id); let parse = db.parse(file_id);
let mut res = Vec::new(); let mut res = Vec::new();
// [#34344] Only take first 500 errors to prevent slowing down editor/ide, the number 500 is chosen arbitrarily. // [#34344] Only take first 128 errors to prevent slowing down editor/ide, the number 128 is chosen arbitrarily.
res.extend(parse.errors().iter().take(500).map(|err| Diagnostic { res.extend(parse.errors().iter().take(128).map(|err| Diagnostic {
range: err.range(), range: err.range(),
message: format!("Syntax Error: {}", err), message: format!("Syntax Error: {}", err),
severity: Severity::Error, severity: Severity::Error,