HiPhish / nvim-ts-rainbow2

Rainbow delimiters for Neovim through Tree-sitter
https://gitlab.com/HiPhish/nvim-ts-rainbow2
Apache License 2.0
338 stars 35 forks source link

Some inner brackets are not highlighted #15

Closed TroySigX closed 1 year ago

TroySigX commented 1 year ago

Describe the bug

I have the following code written in TypeScript:

export function flipColors(c: number[]): number[] {
  return c.map((channel, id) => Math.floor((c[(id + 1) % 3] + c[(id + 2) % 3]) / 2));
}

I notice that the inner brackets (parentheses covering id + 1 and id + 2 aren't colored)

Here is my config:

local rainbow = require 'ts-rainbow'

require('nvim-treesitter.configs').setup({
    rainbow = {
        enable = true,
        query = {
           'rainbow-parens'
        },
        extended_mode = true,
        strategy = rainbow.strategy.global,
        hlgroups = {
           'TSRainbowBlue',
           'TSRainbowViolet',
           'TSRainbowOrange',
           'TSRainbowGreen',
           'TSRainbowYellow',
           'TSRainbowRed',
           'TSRainbowCyan',
        },
    }
})

My color theme is gruvbox-material

Screenshots image

HiPhish commented 1 year ago

It should be fixed now on master. The issue was a missing pattern for parenthesized_expression in the Javascript query (the Typescript query inherits from the Javascript one).

TroySigX commented 1 year ago

Thanks for your quick action!