Document LinterResult::has_syntax_error and add Parsed::has_no_syntax_errors (#16443)

Summary
--

This is a follow up addressing the comments on #16425. As @dhruvmanila
pointed out, the naming is a bit tricky. I went with `has_no_errors` to
try to differentiate it from `is_valid`. It actually ends up negated in
most uses, so it would be more convenient to have `has_any_errors` or
`has_errors`, but I thought it would sound too much like the opposite of
`is_valid` in that case. I'm definitely open to suggestions here.

Test Plan
--

Existing tests.
This commit is contained in:
Brent Westbrook 2025-03-04 08:35:38 -05:00 committed by GitHub
parent a3ae76edc0
commit 37fbe58b13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 50 additions and 26 deletions

View file

@ -102,7 +102,7 @@ mod tests {
let parsed = parsed_module(&db, file);
assert!(parsed.is_valid());
assert!(parsed.has_valid_syntax());
Ok(())
}
@ -118,7 +118,7 @@ mod tests {
let parsed = parsed_module(&db, file);
assert!(parsed.is_valid());
assert!(parsed.has_valid_syntax());
Ok(())
}
@ -134,7 +134,7 @@ mod tests {
let parsed = parsed_module(&db, virtual_file.file());
assert!(parsed.is_valid());
assert!(parsed.has_valid_syntax());
Ok(())
}
@ -150,7 +150,7 @@ mod tests {
let parsed = parsed_module(&db, virtual_file.file());
assert!(parsed.is_valid());
assert!(parsed.has_valid_syntax());
Ok(())
}
@ -181,6 +181,6 @@ else:
let parsed = parsed_module(&db, file);
assert!(parsed.is_valid());
assert!(parsed.has_valid_syntax());
}
}