oxalica / nil

NIx Language server, an incremental analysis assistant for writing in Nix.
Apache License 2.0
1.32k stars 39 forks source link

Highlight `true` and `false` differently #52

Closed figsoda closed 1 year ago

figsoda commented 1 year ago

I'm not aware of anything that can refer to booleans in the standard token types and modifiers, but rust-analyzer seems to use bool_literals, maybe we can use that too

oxalica commented 1 year ago

but rust-analyzer seems to use bool_literals,

No. It's translated into boolean for LSP semantic tokens.

Currently we already highlighted true, false and null with tag constant and modifier builtin. https://github.com/oxalica/nil/blob/0eff7fc333e3c0c064a6339834b44feae00fe64a/crates/nil/src/semantic_tokens.rs#L89-L99

I'm using coc.nvim and CocSemBuiltinConstant can customize it. Or do you mean to separate true/false from null?

figsoda commented 1 year ago

Or do you mean to separate true/false from null?

yes