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

as should be a rustKeyword not rustOperator for syntax highlighting #493

Open
myarcana opened this issue Feb 13, 2023 · 0 comments
Open

Comments

@myarcana
Copy link

myarcana commented Feb 13, 2023

The as keyword is currently a rustOperator according to runtime/syntax/rust.vim, which is kind of surprising because in these kinds of expressions:

use foo as bar;
let thing1: u8 = 7 + 8 as u8;
use std::{mem as memory, net as network};

I expect as to always have the same highlighting as use and let, but not as = or +.

In fact in all rust documentation, it is highlighted as if it were a keyword, not an operator, and in every syntax highlighter online (e.g. right here, and in stackoverflow) it is also highlighted as if it were a keyword and not an operator.

As it stands, gruvbox (a universally loved colorscheme, the most popular Vim and neovim colorscheme) actually makes it look like the syntax file doesn't even support the language feature as.

Screenshot 2023-02-13 at 14 03 49

I think that's very ugly, and confusing. The disparity between everything you read in documentation and your local editor makes you question "is my runtime broken? up-to-date?"

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

1 participant