Retry inlay hint requests

This commit is contained in:
Lukas Wirth 2024-04-28 17:35:43 +02:00
parent e379766311
commit 495afd15d2
2 changed files with 6 additions and 2 deletions

View File

@ -937,7 +937,7 @@ pub(crate) fn handle_completion(
lsp_types::CompletionParams { text_document_position, context,.. }: lsp_types::CompletionParams,
) -> anyhow::Result<Option<lsp_types::CompletionResponse>> {
let _p = tracing::span!(tracing::Level::INFO, "handle_completion").entered();
let mut position = from_proto::file_position(&snap, text_document_position)?;
let mut position = from_proto::file_position(&snap, text_document_position.clone())?;
let line_index = snap.file_line_index(position.file_id)?;
let completion_trigger_character =
context.and_then(|ctx| ctx.trigger_character).and_then(|s| s.chars().next());
@ -1505,6 +1505,10 @@ pub(crate) fn handle_inlay_hints(
)?;
let line_index = snap.file_line_index(file_id)?;
let source_root = snap.analysis.source_root(file_id)?;
let range = TextRange::new(
range.start().min(line_index.index.len()),
range.end().min(line_index.index.len()),
);
let inlay_hints_config = snap.config.inlay_hints(Some(source_root));
Ok(Some(

View File

@ -947,7 +947,7 @@ impl GlobalState {
.on::<NO_RETRY, lsp_request::GotoDeclaration>(handlers::handle_goto_declaration)
.on::<NO_RETRY, lsp_request::GotoImplementation>(handlers::handle_goto_implementation)
.on::<NO_RETRY, lsp_request::GotoTypeDefinition>(handlers::handle_goto_type_definition)
.on::<NO_RETRY, lsp_request::InlayHintRequest>(handlers::handle_inlay_hints)
.on::<RETRY, lsp_request::InlayHintRequest>(handlers::handle_inlay_hints)
.on::<RETRY, lsp_request::InlayHintResolveRequest>(handlers::handle_inlay_hints_resolve)
.on::<NO_RETRY, lsp_request::CodeLensRequest>(handlers::handle_code_lens)
.on::<RETRY, lsp_request::CodeLensResolve>(handlers::handle_code_lens_resolve)