Remove hover inlay tooltips, replace them with location links

This commit is contained in:
Lukas Wirth 2023-01-14 12:19:29 +01:00
parent aafb0f1f8d
commit 60075a6625
15 changed files with 187 additions and 380 deletions

View file

@ -7,7 +7,7 @@ use ide_db::RootDatabase;
use syntax::ast::{self, AstNode};
use crate::{InlayHint, InlayHintsConfig, InlayKind, InlayTooltip};
use crate::{InlayHint, InlayHintsConfig, InlayKind};
pub(super) fn hints(
acc: &mut Vec<InlayHint>,
@ -44,7 +44,6 @@ pub(super) fn hints(
range,
kind: InlayKind::BindingModeHint,
label: r.to_string().into(),
tooltip: Some(InlayTooltip::String("Inferred binding mode".into())),
});
});
match pat {
@ -59,22 +58,11 @@ pub(super) fn hints(
range: pat.syntax().text_range(),
kind: InlayKind::BindingModeHint,
label: bm.to_string().into(),
tooltip: Some(InlayTooltip::String("Inferred binding mode".into())),
});
}
ast::Pat::OrPat(pat) if !pattern_adjustments.is_empty() && outer_paren_pat.is_none() => {
acc.push(InlayHint {
range: pat.syntax().text_range(),
kind: InlayKind::OpeningParenthesis,
label: "(".into(),
tooltip: None,
});
acc.push(InlayHint {
range: pat.syntax().text_range(),
kind: InlayKind::ClosingParenthesis,
label: ")".into(),
tooltip: None,
});
acc.push(InlayHint::opening_paren(pat.syntax().text_range()));
acc.push(InlayHint::closing_paren(pat.syntax().text_range()));
}
_ => (),
}