Remove unnecessary deferred conditional
Co-authored-by: David Kleingeld <davidsk@zed.dev>
This commit is contained in:
parent
c44f9dfb17
commit
4df010d33a
1 changed files with 257 additions and 257 deletions
|
@ -334,7 +334,7 @@ pub fn update_inlay_link_and_hover_points(
|
|||
let excerpt_id = hovered_hint.position.excerpt_id;
|
||||
if let Some(cached_hint) = inlay_hint_cache.hint_by_id(excerpt_id, hovered_hint.id) {
|
||||
// Check if we should process this hint for hover
|
||||
let should_process_hint = match cached_hint.resolve_state {
|
||||
match cached_hint.resolve_state {
|
||||
ResolveState::CanResolve(_, _) => {
|
||||
if let Some(buffer_id) = snapshot
|
||||
.buffer_snapshot
|
||||
|
@ -348,13 +348,8 @@ pub fn update_inlay_link_and_hover_points(
|
|||
cx,
|
||||
);
|
||||
}
|
||||
false // Don't process unresolved hints
|
||||
}
|
||||
ResolveState::Resolved => true,
|
||||
ResolveState::Resolving => false,
|
||||
};
|
||||
|
||||
if should_process_hint {
|
||||
ResolveState::Resolved => {
|
||||
let mut extra_shift_left = 0;
|
||||
let mut extra_shift_right = 0;
|
||||
if cached_hint.padding_left {
|
||||
|
@ -407,7 +402,8 @@ pub fn update_inlay_link_and_hover_points(
|
|||
if part.tooltip.is_some() || part.location.is_some() {
|
||||
// Found the meaningful part - show hover for it
|
||||
let highlight_start = part_offset + extra_shift_left;
|
||||
let highlight_end = part_offset + part_len + extra_shift_right;
|
||||
let highlight_end =
|
||||
part_offset + part_len + extra_shift_right;
|
||||
|
||||
let highlight = InlayHighlight {
|
||||
inlay: hovered_hint.id,
|
||||
|
@ -456,7 +452,8 @@ pub fn update_inlay_link_and_hover_points(
|
|||
editor,
|
||||
InlayHover {
|
||||
tooltip: HoverBlock {
|
||||
text: "Loading documentation...".to_string(),
|
||||
text: "Loading documentation..."
|
||||
.to_string(),
|
||||
kind: HoverBlockKind::PlainText,
|
||||
},
|
||||
range: highlight.clone(),
|
||||
|
@ -593,7 +590,8 @@ pub fn update_inlay_link_and_hover_points(
|
|||
}
|
||||
}
|
||||
|
||||
if let Some((language_server_id, location)) = &part.location {
|
||||
if let Some((language_server_id, location)) = &part.location
|
||||
{
|
||||
if secondary_held
|
||||
&& !editor.has_pending_nonempty_selection()
|
||||
{
|
||||
|
@ -621,6 +619,8 @@ pub fn update_inlay_link_and_hover_points(
|
|||
}
|
||||
};
|
||||
}
|
||||
ResolveState::Resolving => {}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue