mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
fix(lsp): don't error on tsc debug failures for code actions (#10047)
Resolves: #9913
This commit is contained in:
parent
704e1e5330
commit
26c8d824d1
1 changed files with 10 additions and 5 deletions
|
@ -833,12 +833,17 @@ impl Inner {
|
||||||
codes,
|
codes,
|
||||||
));
|
));
|
||||||
let actions: Vec<tsc::CodeFixAction> =
|
let actions: Vec<tsc::CodeFixAction> =
|
||||||
self.ts_server.request(self.snapshot(), req).await.map_err(
|
match self.ts_server.request(self.snapshot(), req).await {
|
||||||
|err| {
|
Ok(items) => items,
|
||||||
|
Err(err) => {
|
||||||
|
// sometimes tsc reports errors when retrieving code actions
|
||||||
|
// because they don't reflect the current state of the document
|
||||||
|
// so we will log them to the output, but we won't send an error
|
||||||
|
// message back to the client.
|
||||||
error!("Error getting actions from TypeScript: {}", err);
|
error!("Error getting actions from TypeScript: {}", err);
|
||||||
LspError::internal_error()
|
Vec::new()
|
||||||
},
|
}
|
||||||
)?;
|
};
|
||||||
for action in actions {
|
for action in actions {
|
||||||
code_actions
|
code_actions
|
||||||
.add_ts_fix_action(&action, diagnostic, self)
|
.add_ts_fix_action(&action, diagnostic, self)
|
||||||
|
|
Loading…
Add table
Reference in a new issue