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

Highlight true and false differently #52

Closed
figsoda opened this issue Jan 8, 2023 · 2 comments
Closed

Highlight true and false differently #52

figsoda opened this issue Jan 8, 2023 · 2 comments
Labels
A-lsp Area: LSP conformance issues and missing features C-support Catagory: support questions

Comments

@figsoda
Copy link
Contributor

figsoda commented Jan 8, 2023

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 oxalica added C-support Catagory: support questions A-lsp Area: LSP conformance issues and missing features labels Jan 8, 2023
@oxalica
Copy link
Owner

oxalica commented Jan 8, 2023

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.

HlTag::Builtin(kind) => {
mods.insert(TokenModIdx::Builtin);
match kind {
BuiltinKind::Const => {
mods.insert(TokenModIdx::Readonly);
TokenTypeIdx::Constant
}
BuiltinKind::Function => TokenTypeIdx::Function,
BuiltinKind::Attrset => TokenTypeIdx::Struct,
}
}

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

@figsoda
Copy link
Contributor Author

figsoda commented Jan 8, 2023

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

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lsp Area: LSP conformance issues and missing features C-support Catagory: support questions
Projects
None yet
Development

No branches or pull requests

2 participants