From 18e9f4642cc9ff598105a0d51263e307949c0423 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 11 May 2023 12:04:27 -0400 Subject: [PATCH] fix(lsp): hard to soft error when unable to get completion info (#19091) --- cli/lsp/language_server.rs | 11 +++++++---- runtime/ops/process.rs | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs index d32d12ec8b..1eb3944726 100644 --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -2194,10 +2194,13 @@ impl Inner { )); let snapshot = self.snapshot(); let maybe_completion_info: Option = - self.ts_server.request(snapshot, req).await.map_err(|err| { - error!("Unable to get completion info from TypeScript: {}", err); - LspError::internal_error() - })?; + match self.ts_server.request(snapshot, req).await { + Ok(maybe_info) => maybe_info, + Err(err) => { + error!("Unable to get completion info from TypeScript: {:#}", err); + None + } + }; if let Some(completions) = maybe_completion_info { let results = completions.as_completion_response( diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index 76db23d029..a2eace8b6a 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -597,7 +597,6 @@ mod deprecated { #[cfg(not(unix))] pub fn kill(pid: i32, signal: &str) -> Result<(), AnyError> { - use deno_core::error::type_error; use std::io::Error; use std::io::ErrorKind::NotFound; use winapi::shared::minwindef::DWORD;