[ty] Gracefully handle salsa cancellations and panics in background request handlers (#18254)

This commit is contained in:
Micha Reiser 2025-05-26 14:37:49 +02:00 committed by GitHub
parent d51f6940fe
commit d8216fa328
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 146 additions and 95 deletions

View file

@ -187,14 +187,14 @@ impl Workspace {
/// Checks a single file.
#[wasm_bindgen(js_name = "checkFile")]
pub fn check_file(&self, file_id: &FileHandle) -> Result<Vec<Diagnostic>, Error> {
let result = self.db.check_file(file_id.file).map_err(into_error)?;
let result = self.db.check_file(file_id.file);
Ok(result.into_iter().map(Diagnostic::wrap).collect())
}
/// Checks all open files
pub fn check(&self) -> Result<Vec<Diagnostic>, Error> {
let result = self.db.check().map_err(into_error)?;
let result = self.db.check();
Ok(result.into_iter().map(Diagnostic::wrap).collect())
}