rust-lang / rust-lang/rust-analyzer
Emit semantic token modifier `async` for impl Future
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
I randomly discovered async token modifiers getting emitted and thought it might be an interesting thing to set up to get highlighted using a specific color.
However, I noticed that some futures did not get that token modifier, leading to a confusing result, so I disabled it for now. Libraries like embassy seem to use a lot of manually implemented impl Future fns or structs that impl Future.
It would be great if the async token modifier could also get emitted for functions that don't use the async keyword but return impl Future, as well as ones that return a struct that impls Future.
Examples, note the different highlighting where the greenish color comes from the async token modifier and the yellowish one is the usual one for functions/methods:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by locating rust-analyzer's semantic-token generation and the existing handling for the async token modifier, then compare async-keyword functions with functions returning impl Future or a Future-implementing struct. Done means the modifier is emitted for the requested cases without changing existing highlighting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100