Skip to content

Commit cf152e8

Browse files
committed
Auto merge of rust-lang#12201 - Veykril:inlay-hide, r=Veykril
fix: Add cast expressions to param name inlay hint heuristics
2 parents ad6df5b + 822d9b5 commit cf152e8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

crates/ide/src/inlay_hints.rs

+2
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ fn get_string_representation(expr: &ast::Expr) -> Option<String> {
808808
ast::Expr::PathExpr(path_expr) => Some(path_expr.path()?.segment()?.to_string()),
809809
ast::Expr::PrefixExpr(prefix_expr) => get_string_representation(&prefix_expr.expr()?),
810810
ast::Expr::RefExpr(ref_expr) => get_string_representation(&ref_expr.expr()?),
811+
ast::Expr::CastExpr(cast_expr) => get_string_representation(&cast_expr.expr()?),
811812
_ => None,
812813
}
813814
}
@@ -1173,6 +1174,7 @@ fn main() {
11731174
11741175
let param = 0;
11751176
foo(param);
1177+
foo(param as _);
11761178
let param_end = 0;
11771179
foo(param_end);
11781180
let start_param = 0;

crates/rust-analyzer/src/integrated_benchmarks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn integrated_highlighting_benchmark() {
3131

3232
// Load rust-analyzer itself.
3333
let workspace_to_load = project_root();
34-
let file = "./crates/ide_db/src/apply_change.rs";
34+
let file = "./crates/ide-db/src/apply_change.rs";
3535

3636
let cargo_config = CargoConfig::default();
3737
let load_cargo_config = LoadCargoConfig {

0 commit comments

Comments
 (0)