Smart function parameter completion with ownership/borrow variants

When creating a new function in RustRover, the IDE already provides context-aware code completion for parameter names and types. It would be very helpful if this completion could also suggest ownership variants (T, &T, &mut T) and make them easily selectable during signature creation.

For example, when typing:

fn process_user(u)

RustRover could suggest completions such as:

user: User
user: &User
user: &mut User

Ideally, these suggestions would be:

  • Context-aware (based on the function name, parameter name, and available types)
  • Easy to cycle through or select (similar to existing type/name completion)
  • Integrated into normal code completion rather than requiring a separate refactoring

Motivation / Use case
Choosing between owned and borrowed parameters is a frequent and early design decision in Rust. Making borrow/reference variants first-class in function signature completion would:

  • Reduce friction when writing idiomatic Rust
  • Encourage correct borrowing patterns early
  • Reduce the need to rewrite signatures or rely on later refactoring

This would be especially useful when sketching APIs or writing small helper functions where ownership intent is obvious from naming and context.

Current state:

1

Please sign in to leave a comment.