mirror of
https://github.com/denoland/deno.git
synced 2024-11-23 15:16:54 -05:00
fix(lsp): don't error if completionItem/resolve request fails (#17250)
This commit is contained in:
parent
7177768e49
commit
a012d731ee
1 changed files with 23 additions and 20 deletions
|
@ -1959,28 +1959,31 @@ impl Inner {
|
||||||
if let Some(data) = &data.tsc {
|
if let Some(data) = &data.tsc {
|
||||||
let specifier = &data.specifier;
|
let specifier = &data.specifier;
|
||||||
let req = tsc::RequestMethod::GetCompletionDetails(data.into());
|
let req = tsc::RequestMethod::GetCompletionDetails(data.into());
|
||||||
let maybe_completion_info: Option<tsc::CompletionEntryDetails> =
|
let result: Result<Option<tsc::CompletionEntryDetails>, _> =
|
||||||
self.ts_server.request(self.snapshot(), req).await.map_err(
|
self.ts_server.request(self.snapshot(), req).await;
|
||||||
|err| {
|
match result {
|
||||||
error!("Unable to get completion info from TypeScript: {}", err);
|
Ok(maybe_completion_info) => {
|
||||||
LspError::internal_error()
|
if let Some(completion_info) = maybe_completion_info {
|
||||||
},
|
completion_info
|
||||||
)?;
|
.as_completion_item(¶ms, data, specifier, self)
|
||||||
if let Some(completion_info) = maybe_completion_info {
|
.map_err(|err| {
|
||||||
completion_info
|
error!(
|
||||||
.as_completion_item(¶ms, data, specifier, self)
|
"Failed to serialize virtual_text_document response: {}",
|
||||||
.map_err(|err| {
|
err
|
||||||
|
);
|
||||||
|
LspError::internal_error()
|
||||||
|
})?
|
||||||
|
} else {
|
||||||
error!(
|
error!(
|
||||||
"Failed to serialize virtual_text_document response: {}",
|
"Received an undefined response from tsc for completion details."
|
||||||
err
|
|
||||||
);
|
);
|
||||||
LspError::internal_error()
|
params
|
||||||
})?
|
}
|
||||||
} else {
|
}
|
||||||
error!(
|
Err(err) => {
|
||||||
"Received an undefined response from tsc for completion details."
|
error!("Unable to get completion info from TypeScript: {}", err);
|
||||||
);
|
return Ok(params);
|
||||||
params
|
}
|
||||||
}
|
}
|
||||||
} else if let Some(url) = data.documentation {
|
} else if let Some(url) = data.documentation {
|
||||||
CompletionItem {
|
CompletionItem {
|
||||||
|
|
Loading…
Reference in a new issue