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

Font-lock confused by apparent float suffix in non-decimal literal #540

Open
timmc opened this issue Apr 19, 2024 · 5 comments
Open

Font-lock confused by apparent float suffix in non-decimal literal #540

timmc opened this issue Apr 19, 2024 · 5 comments

Comments

@timmc
Copy link

timmc commented Apr 19, 2024

The string 0xf64 is a hex literal (for the number 3940), but rust-mode highlights the f64 as a type suffix, making it appear to be a floating point number. This also happens when there are leading digits, such as in 0x1234f64.

Not a huge deal, but maybe something that you want to fix.

@psibi
Copy link
Member

psibi commented Apr 21, 2024

Can you check if it works with tree sitter mode: https://github.com/rust-lang/rust-mode?tab=readme-ov-file#tree-sitter ?

@timmc
Copy link
Author

timmc commented Apr 27, 2024

I got tree-sitter mode working, but... the syntax highlighting colors the entire number the same way and no longer highlights the prefix! So technically this fixes the bug, but not in the desired way. :-P

@psibi
Copy link
Member

psibi commented Apr 29, 2024

Ah, I see. :-) I see the same behavior using LSP's semantic tokens too. I would recommend opening a bug report in Emacs for this.

@timmc
Copy link
Author

timmc commented Apr 29, 2024

Can you tell me more about why this would be an Emacs bug? It seems specific to Rust syntax. (As it's a minor thing, I'm not super likely to file another bug, but I'm curious.)

@psibi
Copy link
Member

psibi commented Apr 29, 2024

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