Rust Analyzer always completes Bevy system functions as function calls (e.g. setup(commands)) — can this behavior be adjusted? #22374
Unanswered
not-null-nil
asked this question in
Q&A
Replies: 1 comment
-
|
It's a known limitation. I don't know that anyone has a workaround. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m working with Bevy (0.17.x) and noticed an IDE completion behavior that’s a bit disruptive when writing ECS-style code.
Example:
.add_systems(Startup, setup)
When I type setup and trigger completion in VS Code / Emacs (rust-analyzer), it almost always expands to:
setup(commands)
But in Bevy, add_systems expects a system function reference, not a function call.
So I frequently have to manually delete the inserted arguments.
I understand why rust-analyzer does this (it treats it as a normal callable), but in Bevy-style APIs (add_systems, run_if, etc.) this pattern is extremely common.
My questions:
Is there a rust-analyzer setting that improves this behavior for ECS / function-as-value usage?
Is disabling callableSnippets ("completion.callable.snippets": "none") the recommended approach for Bevy projects?
Are there any editor-side or Bevy-side conventions people use to reduce this friction?
I’m mainly curious whether:
this is a known limitation,
there’s an accepted configuration for Bevy-heavy codebases,
or if there’s ongoing work in rust-analyzer to better handle function references in these contexts.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions