0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

fix(lsp): don't error on tsc debug failures for code actions (#10047)

Resolves: #9913
This commit is contained in:
Kitson Kelly 2021-04-07 19:47:31 +10:00 committed by GitHub
parent 704e1e5330
commit 26c8d824d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -833,12 +833,17 @@ impl Inner {
codes,
));
let actions: Vec<tsc::CodeFixAction> =
self.ts_server.request(self.snapshot(), req).await.map_err(
|err| {
match self.ts_server.request(self.snapshot(), req).await {
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);
LspError::internal_error()
},
)?;
Vec::new()
}
};
for action in actions {
code_actions
.add_ts_fix_action(&action, diagnostic, self)