chore: fix flaky lsp_vendor_dir (#22483)

I think it was occassionally reading the diagnostics from the previous
cache command rather than the config update.

Closes #22481
This commit is contained in:
David Sherret 2024-02-20 13:39:03 -05:00 committed by GitHub
parent 4201f17936
commit dbc4a4d632
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -10666,6 +10666,10 @@ fn lsp_vendor_dir() {
assert!(!temp_dir.path().join("vendor").exists());
// read the diagnostic update after caching
let diagnostics = client.read_diagnostics();
assert_eq!(diagnostics.all().len(), 0);
temp_dir.write(
temp_dir.path().join("deno.json"),
"{ \"vendor\": true, \"lock\": false }\n",

View file

@ -799,7 +799,7 @@ impl LspClient {
result.as_u64().unwrap() as usize
}
/// Reads the latest diagnostics. It's assumed that
/// Reads the latest diagnostics.
pub fn read_diagnostics(&mut self) -> CollectedDiagnostics {
// wait for three (deno, lint, and typescript diagnostics) batch
// notification messages for that index