mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Improve inlay hint resolution reliability
This commit is contained in:
parent
13ac53e73d
commit
5ca5d52697
20 changed files with 282 additions and 216 deletions
|
@ -3,6 +3,8 @@
|
|||
//! static S: &/* 'static */str = "";
|
||||
//! ```
|
||||
use either::Either;
|
||||
use ide_db::famous_defs::FamousDefs;
|
||||
use span::EditionedFileId;
|
||||
use syntax::{
|
||||
ast::{self, AstNode},
|
||||
SyntaxKind,
|
||||
|
@ -12,7 +14,9 @@ use crate::{InlayHint, InlayHintPosition, InlayHintsConfig, InlayKind, LifetimeE
|
|||
|
||||
pub(super) fn hints(
|
||||
acc: &mut Vec<InlayHint>,
|
||||
FamousDefs(_sema, _): &FamousDefs<'_, '_>,
|
||||
config: &InlayHintsConfig,
|
||||
_file_id: EditionedFileId,
|
||||
statik_or_const: Either<ast::Static, ast::Const>,
|
||||
) -> Option<()> {
|
||||
if config.lifetime_elision_hints != LifetimeElisionHints::Always {
|
||||
|
@ -38,6 +42,7 @@ pub(super) fn hints(
|
|||
position: InlayHintPosition::After,
|
||||
pad_left: false,
|
||||
pad_right: true,
|
||||
resolve_parent: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue