Stop eagerly resolving inlay hint text edits for VSCode

After https://github.com/microsoft/vscode/issues/193124 was fixed,
this change is not needed anymore.
This commit is contained in:
Kirill Bulatov 2024-01-11 01:49:33 +02:00 committed by Lukas Wirth
parent 0931361b8f
commit 57a0ad4343

View File

@ -443,17 +443,16 @@ pub(crate) fn inlay_hint(
file_id: FileId, file_id: FileId,
inlay_hint: InlayHint, inlay_hint: InlayHint,
) -> Cancellable<lsp_types::InlayHint> { ) -> Cancellable<lsp_types::InlayHint> {
let is_visual_studio_code = snap.config.is_visual_studio_code();
let needs_resolve = inlay_hint.needs_resolve; let needs_resolve = inlay_hint.needs_resolve;
let (label, tooltip, mut something_to_resolve) = let (label, tooltip, mut something_to_resolve) =
inlay_hint_label(snap, fields_to_resolve, needs_resolve, inlay_hint.label)?; inlay_hint_label(snap, fields_to_resolve, needs_resolve, inlay_hint.label)?;
let text_edits = let text_edits = if needs_resolve && fields_to_resolve.resolve_text_edits {
if !is_visual_studio_code && needs_resolve && fields_to_resolve.resolve_text_edits {
something_to_resolve |= inlay_hint.text_edit.is_some(); something_to_resolve |= inlay_hint.text_edit.is_some();
None None
} else { } else {
inlay_hint.text_edit.map(|it| text_edit_vec(line_index, it)) inlay_hint.text_edit.map(|it| text_edit_vec(line_index, it))
}; };
let data = if needs_resolve && something_to_resolve { let data = if needs_resolve && something_to_resolve {
Some(to_value(lsp_ext::InlayHintResolveData { file_id: file_id.index() }).unwrap()) Some(to_value(lsp_ext::InlayHintResolveData { file_id: file_id.index() }).unwrap())
} else { } else {