diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index 232b528e81..8e8a751a2b 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -833,12 +833,17 @@ impl Inner { codes, )); let actions: Vec = - 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)