Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust-mode only sparsely highlights code in Emacs 29.1 #499

Open
yanchith opened this issue Aug 1, 2023 · 3 comments
Open

rust-mode only sparsely highlights code in Emacs 29.1 #499

yanchith opened this issue Aug 1, 2023 · 3 comments

Comments

@yanchith
Copy link
Contributor

yanchith commented Aug 1, 2023

With identical config 29.1 behaves like in the screenshot below and 28.2 works fine. Notice how only some of the keywords are highlighted.

image

@psibi
Copy link
Member

psibi commented Feb 24, 2024

Is this also reproducible when you use via tree sitter mode: https://github.com/rust-lang/rust-mode?tab=readme-ov-file#tree-sitter ?

@yanchith
Copy link
Contributor Author

I haven't tried. To be honest, I was having a hard time of getting tree-sitter to work on Windows¹ back when I created this thread: both compiling the grammars on Windows or finding a precompiled grammar that's not severely out of date (or incomplete, I couldn't tell). After a few hours, I decided it's best for me to avoid tree-sitter until the experience improves. If you know of a good place of getting an up to date for Rust grammar, ideally already compiled, I'd be grateful.

Does your question mean that support for Emacs 29 without tree-sitter is not planned?

¹: Not my only dev machine, but I'd like to keep it running.

@psibi
Copy link
Member

psibi commented Feb 25, 2024

Does your question mean that support for Emacs 29 without tree-sitter is not planned?

Both are supported right now with optional opt in to tree-sitter. But bugs like this are very hard to fix in the traditional rust-mode since it relies on regular expressions to match patterns which is error prone. Using something like tree sitter offers a better solution to these kind of highlighting and other issues.

If you know of a good place of getting an up to date for Rust grammar, ideally already compiled, I'd be grateful.

Unfortunately I don't know of a good place to recommend. I personally use the one from Nix package manager, but I don't think it has Windows support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants