rust-lang / rust-lang/rust-mode
Behavior with enum variants, using treesitter
Nobody has claimed this yet.
- Dominant language
- Emacs Lisp
- Stars
- 1.3k
- Forks
- 198
- PR merge metrics
- No merged PRs in 30d
Description
Hello
I just tested the new rust-ts-mode with emacs 29, and it seems to be working well.
I can already see some improvements, compared to some cases where rust-mode was having some issues, both in fontifications and identations.
Thanks to everyone who worked on that integration.
However I've noticed an issue with enum variants:
This is my buffer using the legacy rust-mode:
The same buffer using rust-ts-mode, with treesit-font-lock-level set to 3:
Notice the variants are using white color.
Same buffer using rust-ts-mode, with treesit-font-lock-level set to 4:
Here we have 3 different colors, for variants
Ideally I would like to get the same colors/fontification than rust-mode (variants in green).
What would be the correct way to customize that ?
Thanks
cc @casouri @psibi
Contributor guide
No contributing guide indexed for this repository
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
Start with the rust-ts-mode and rust-mode entry points, comparing their enum-variant fontification while testing treesit-font-lock-level values 3 and 4. Determine how enum variants can receive the same coloring as rust-mode, then verify that the resulting rust-ts-mode display uses consistent variant colors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs, emacs-lisp, rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100