mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-07 00:50:37 +00:00
[ty] Gracefully handle salsa cancellations and panics in background request handlers (#18254)
This commit is contained in:
parent
d51f6940fe
commit
d8216fa328
9 changed files with 146 additions and 95 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue