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

Treesitter Highlighting Looks Worse for Rust #196

Open
mike-lloyd03 opened this issue Dec 18, 2023 · 1 comment
Open

Treesitter Highlighting Looks Worse for Rust #196

mike-lloyd03 opened this issue Dec 18, 2023 · 1 comment

Comments

@mike-lloyd03
Copy link

mike-lloyd03 commented Dec 18, 2023

Thanks for this plugin. I love onedark and I think your approach to it is the easiest one to use.

I just noticed today that I didn't have the Rust treesitter parser installed. I was getting syntax highlighting probably through the "rust-tools.nvim" plugin previously.

When I enable treesitter highlighting with TSEnable highlight, almost everything remains the same except for three things:

  • ? operators
  • & operators
  • Angle brackets

The highlight for these nodes makes them hard to distinguish from other text.

Is this intended? Or do I have a conflict somewhere?

Here's some pictures for reference:

TS Highlighting Disabled:
Screenshot_20231217_205500

TS Highlighting Enabled:
Screenshot_20231217_205447

Here's my config:

-- Color scheme config
require("onedark").setup({
    style = "deep",
    toggle_style_key = "<leader>ts",
    lualine = {
        transparent = true,
    },
    highlights = {
        MatchParen = { fg = "$red", bg = "$none", fmt = "underline" },

        TelescopeBorder = { fg = "$light_grey" },
        TelescopePromptBorder = { fg = "$light_grey" },
        TelescopeResultsBorder = { fg = "$light_grey" },
        TelescopePreviewBorder = { fg = "$light_grey" },
        TelescopeMatching = { fg = "$orange", fmt = "bold" },
        TelescopePromptPrefix = { fg = "$red" },

        CurSearch = { bg = "$fg" },
        IncSearch = { bg = "$fg" },
        Search = { bg = "$blue" },

        FoldColumn = { bg = "$bg0" },
    },
    diagnostics = {
        darker = true,
        undercurl = true,
    },
})
require("onedark").load()

Thank you.

@mike-lloyd03
Copy link
Author

Also, I can't figure out the highlight keyword for the ? operator. Treesitter says the node is try_expression but this doesn't work:

["@try_expression"] = { fg = "$red"}

I think I'm not understanding how to identify treesitter keywords from the readme.

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