mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-11-04 05:35:55 +00:00 
			
		
		
		
	Merge pull request #18809 from Veykril/push-ktwrzsmzlplw
internal: Do not render closure ids in hover messages
This commit is contained in:
		
						commit
						e5950cd41d
					
				
					 3 changed files with 3 additions and 9 deletions
				
			
		| 
						 | 
					@ -890,12 +890,11 @@ fn closure_ty(
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        String::new()
 | 
					        String::new()
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    let mut markup = format!("```rust\n{}", c.display_with_id(sema.db, edition));
 | 
					    let mut markup = format!("```rust\n{}\n```", c.display_with_impl(sema.db, edition));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if let Some(trait_) = c.fn_trait(sema.db).get_id(sema.db, original.krate(sema.db).into()) {
 | 
					    if let Some(trait_) = c.fn_trait(sema.db).get_id(sema.db, original.krate(sema.db).into()) {
 | 
				
			||||||
        push_new_def(hir::Trait::from(trait_).into())
 | 
					        push_new_def(hir::Trait::from(trait_).into())
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    format_to!(markup, "\n{}\n```", c.display_with_impl(sema.db, edition),);
 | 
					 | 
				
			||||||
    if let Some(layout) =
 | 
					    if let Some(layout) =
 | 
				
			||||||
        render_memory_layout(config.memory_layout, || original.layout(sema.db), |_| None, |_| None)
 | 
					        render_memory_layout(config.memory_layout, || original.layout(sema.db), |_| None, |_| None)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -348,7 +348,6 @@ fn main() {
 | 
				
			||||||
        expect![[r#"
 | 
					        expect![[r#"
 | 
				
			||||||
            *|*
 | 
					            *|*
 | 
				
			||||||
            ```rust
 | 
					            ```rust
 | 
				
			||||||
            {closure#0}
 | 
					 | 
				
			||||||
            impl Fn(i32) -> i32
 | 
					            impl Fn(i32) -> i32
 | 
				
			||||||
            ```
 | 
					            ```
 | 
				
			||||||
            ___
 | 
					            ___
 | 
				
			||||||
| 
						 | 
					@ -372,7 +371,6 @@ fn main() {
 | 
				
			||||||
        expect![[r#"
 | 
					        expect![[r#"
 | 
				
			||||||
            *|*
 | 
					            *|*
 | 
				
			||||||
            ```rust
 | 
					            ```rust
 | 
				
			||||||
            {closure#0}
 | 
					 | 
				
			||||||
            impl Fn(i32) -> i32
 | 
					            impl Fn(i32) -> i32
 | 
				
			||||||
            ```
 | 
					            ```
 | 
				
			||||||
            ___
 | 
					            ___
 | 
				
			||||||
| 
						 | 
					@ -407,7 +405,6 @@ fn main() {
 | 
				
			||||||
        expect![[r#"
 | 
					        expect![[r#"
 | 
				
			||||||
            *|*
 | 
					            *|*
 | 
				
			||||||
            ```rust
 | 
					            ```rust
 | 
				
			||||||
            {closure#0}
 | 
					 | 
				
			||||||
            impl FnOnce()
 | 
					            impl FnOnce()
 | 
				
			||||||
            ```
 | 
					            ```
 | 
				
			||||||
            ___
 | 
					            ___
 | 
				
			||||||
| 
						 | 
					@ -437,7 +434,6 @@ fn main() {
 | 
				
			||||||
        expect![[r#"
 | 
					        expect![[r#"
 | 
				
			||||||
            *|*
 | 
					            *|*
 | 
				
			||||||
            ```rust
 | 
					            ```rust
 | 
				
			||||||
            {closure#0}
 | 
					 | 
				
			||||||
            impl FnMut()
 | 
					            impl FnMut()
 | 
				
			||||||
            ```
 | 
					            ```
 | 
				
			||||||
            ___
 | 
					            ___
 | 
				
			||||||
| 
						 | 
					@ -463,7 +459,6 @@ fn main() {
 | 
				
			||||||
"#,
 | 
					"#,
 | 
				
			||||||
        expect![[r#"
 | 
					        expect![[r#"
 | 
				
			||||||
            ```rust
 | 
					            ```rust
 | 
				
			||||||
            {closure#0}
 | 
					 | 
				
			||||||
            impl FnOnce() -> S2
 | 
					            impl FnOnce() -> S2
 | 
				
			||||||
            ```
 | 
					            ```
 | 
				
			||||||
            ___
 | 
					            ___
 | 
				
			||||||
| 
						 | 
					@ -3017,7 +3012,6 @@ fn main() {
 | 
				
			||||||
        expect![[r#"
 | 
					        expect![[r#"
 | 
				
			||||||
            *|*
 | 
					            *|*
 | 
				
			||||||
            ```rust
 | 
					            ```rust
 | 
				
			||||||
            {closure#0}
 | 
					 | 
				
			||||||
            impl Fn(i32) -> i32
 | 
					            impl Fn(i32) -> i32
 | 
				
			||||||
            ```
 | 
					            ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -61,7 +61,6 @@ pub(super) fn hints(
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        hint.label.append_str(r);
 | 
					        hint.label.append_str(r);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    hint.pad_right = was_mut_last;
 | 
					 | 
				
			||||||
    let acc_base = acc.len();
 | 
					    let acc_base = acc.len();
 | 
				
			||||||
    match pat {
 | 
					    match pat {
 | 
				
			||||||
        ast::Pat::IdentPat(pat) if pat.ref_token().is_none() && pat.mut_token().is_none() => {
 | 
					        ast::Pat::IdentPat(pat) if pat.ref_token().is_none() && pat.mut_token().is_none() => {
 | 
				
			||||||
| 
						 | 
					@ -86,6 +85,7 @@ pub(super) fn hints(
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        ast::Pat::OrPat(pat) if !pattern_adjustments.is_empty() && outer_paren_pat.is_none() => {
 | 
					        ast::Pat::OrPat(pat) if !pattern_adjustments.is_empty() && outer_paren_pat.is_none() => {
 | 
				
			||||||
            hint.label.append_str("(");
 | 
					            hint.label.append_str("(");
 | 
				
			||||||
 | 
					            was_mut_last = false;
 | 
				
			||||||
            acc.push(InlayHint::closing_paren_after(
 | 
					            acc.push(InlayHint::closing_paren_after(
 | 
				
			||||||
                InlayKind::BindingMode,
 | 
					                InlayKind::BindingMode,
 | 
				
			||||||
                pat.syntax().text_range(),
 | 
					                pat.syntax().text_range(),
 | 
				
			||||||
| 
						 | 
					@ -94,6 +94,7 @@ pub(super) fn hints(
 | 
				
			||||||
        _ => (),
 | 
					        _ => (),
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if !hint.label.parts.is_empty() {
 | 
					    if !hint.label.parts.is_empty() {
 | 
				
			||||||
 | 
					        hint.pad_right = was_mut_last;
 | 
				
			||||||
        acc.push(hint);
 | 
					        acc.push(hint);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue