1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 07:44:48 -05:00

fix(lsp): hard to soft error when unable to get completion info (#19091)

This commit is contained in:
David Sherret 2023-05-11 12:04:27 -04:00 committed by GitHub
parent 78c7ff91e3
commit 18e9f4642c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -2194,10 +2194,13 @@ impl Inner {
));
let snapshot = self.snapshot();
let maybe_completion_info: Option<tsc::CompletionInfo> =
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(

View file

@ -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;