tree-sitter / tree-sitter-rust

Rust grammar for tree-sitter
MIT License
350 stars 98 forks source link

Is it possible to color enum items/members? #158

Closed amaanq closed 1 year ago

amaanq commented 2 years ago

As the title suggests, I would like to know if it's possible to use a custom color for enum items. It is very unclear and difficult to me to figure out the tags to use to change the color, but here's what I have so far...

highlights = {
    ["@field.rust"] = { fg = "${red}" },
    ["@function.macro.rust"] = { fg = "${orange}" },
    ["@keyword.rust"] = { fg = "${purple}" },
    ["@label.rust"] = { fg = "${white}" },
    ["@operator.rust"] = { fg = "${white}" },
    ["@parameter.rust"] = { fg = "${red}", style = "italic" },
    ["@punctuation.bracket.rust"] = { fg = "${purple}" },
    ["@variable.builtin.rust"] = { fg = "${purple}", style = "italic" },
}

Thanks!

bew commented 1 year ago

(why not keep it open?)

amaanq commented 1 year ago

it's a nvim-treesitter problem, and not sure if I can call it a problem since tree-sitter isnt an LSP, but I'm sure query match predicates can alleviate this anyways...there's an issue for this over there already.