atom-language-rust icon indicating copy to clipboard operation
atom-language-rust copied to clipboard

Allow Rust core types to be highlighted just like user types

Open alexr00 opened this issue 5 years ago • 5 comments

From @nox on February 2, 2019 15:15

I'm tired of seeing char, bool, etc being highlighted differently than Arc<T> etc, especially when char and friends can appear in module paths, where they don't refer to the core type. Is there any chance the theme could be updated to stop doing that?

Edit to include info from the comments: The grammar categorizes char in core::char::DecodeUtf16Error as storage.type.core.rust and it should probably just categorize it as source.rust.

Copied from original issue: Microsoft/vscode#67788

alexr00 avatar Feb 04 '19 10:02 alexr00

From @dbaeumer on February 4, 2019 8:46

Not sure if this is a theme or grammar problem.

alexr00 avatar Feb 04 '19 10:02 alexr00

@nox, I'm not very familiar with Rust. Is this an example of the different highlighting? image

alexr00 avatar Feb 04 '19 10:02 alexr00

From @nox on February 4, 2019 10:26

    core::char::DecodeUtf16Error,
    core::char::EscapeDebug,
    core::char::EscapeDefault,
    core::char::EscapeUnicode,
    core::char::ParseCharError,
    core::char::ToLowercase,
    core::char::ToUppercase,

Basically, those identifiers always appear in a different colour wherever they are. I filed an issue here because while I mostly do Rust, this is a common thing that themes do in all editors: colour things that it considers primitive/core/whatever in a different way, and I would like to be able to disable the behaviour across the board.

alexr00 avatar Feb 04 '19 10:02 alexr00

From @nox on February 4, 2019 10:28

Like, is there a way to tell the editor to paint things a different colour that is used by a different class of tokens, without giving it that specific other colour?

alexr00 avatar Feb 04 '19 10:02 alexr00

I see, thanks for the example. This is an issue with the grammar we use for Rust. It categorizes char in core::char::DecodeUtf16Error as storage.type.core.rust and it should probably just categorize it as source.rust.

alexr00 avatar Feb 04 '19 10:02 alexr00