mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Use a hash to find the correct inlay hint when resolving
This commit is contained in:
parent
3115fd8b41
commit
4a93368590
7 changed files with 108 additions and 67 deletions
|
@ -90,7 +90,7 @@ pub use crate::{
|
|||
inlay_hints::{
|
||||
AdjustmentHints, AdjustmentHintsMode, ClosureReturnTypeHints, DiscriminantHints,
|
||||
InlayFieldsToResolve, InlayHint, InlayHintLabel, InlayHintLabelPart, InlayHintPosition,
|
||||
InlayHintsConfig, InlayKind, InlayTooltip, LifetimeElisionHints, RangeLimit,
|
||||
InlayHintsConfig, InlayKind, InlayTooltip, LifetimeElisionHints,
|
||||
},
|
||||
join_lines::JoinLinesConfig,
|
||||
markup::Markup,
|
||||
|
@ -415,10 +415,19 @@ impl Analysis {
|
|||
&self,
|
||||
config: &InlayHintsConfig,
|
||||
file_id: FileId,
|
||||
range: Option<RangeLimit>,
|
||||
range: Option<TextRange>,
|
||||
) -> Cancellable<Vec<InlayHint>> {
|
||||
self.with_db(|db| inlay_hints::inlay_hints(db, file_id, range, config))
|
||||
}
|
||||
pub fn inlay_hints_resolve(
|
||||
&self,
|
||||
config: &InlayHintsConfig,
|
||||
file_id: FileId,
|
||||
position: TextSize,
|
||||
hash: u64,
|
||||
) -> Cancellable<Option<InlayHint>> {
|
||||
self.with_db(|db| inlay_hints::inlay_hints_resolve(db, file_id, position, hash, config))
|
||||
}
|
||||
|
||||
/// Returns the set of folding ranges.
|
||||
pub fn folding_ranges(&self, file_id: FileId) -> Cancellable<Vec<Fold>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue