Open ChayimFriedman2 opened 1 month ago
In this case, the match
has no other arms, so the expected_ty
can be unified with the completed_ty
, making the two equivalent. In other words, r-a
considers it valid for the match
to directly return the function pointer foo
, and therefore, it won't automatically add parentheses.
Well yes, but I don't think that's good behavior. r-a should at least also offer the full completion, probably only it if the match
is not inside other expression.
When
"rust-analyzer.completion.callable.snippets": "fill_arguments"
is set, r-a completes the parens for function calls flawlessly in most situations. But when inside a match arm, if I only typed part of the symbol (e.g.fo
offn foo()
), it will complete the arguments, but if I typed it all, accepting the completion will do nothing.Here's a short video:
https://github.com/user-attachments/assets/eddab49e-7201-4a8a-b5f5-249d17c03d50
rust-analyzer version: 0.3.2096-standalone (779d9eee2 2024-09-01)
rustc version: rustc 1.81.0 (eeb90cda1 2024-09-04)
editor or extension: VSCode
relevant settings:
@rustbot label +A-ide +A-completion