p00f / nvim-ts-rainbow

Rainbow parentheses for neovim using tree-sitter. Use https://sr.ht/~p00f/nvim-ts-rainbow instead
Apache License 2.0
869 stars 67 forks source link

Tsx colors are the other way around #123

Closed FernandoChu closed 2 years ago

FernandoChu commented 2 years ago

Describe the bug Tsx colors are the other way around, tags are getting colored, while typescript type annotations are not.

Steps to reproduce Enable rainbow without extended_mode.

  rainbow = {
    enable = true,
    extended_mode = false
  }

Example code:

const Secret = () => {
  const test: Array<Array<number>> = [[]];

  return (
    <main>
      <div>
        <p>{test}</p>
      </div>
    </main>
  );
};

export default Secret;

Expected behavior Same behavior as jsx files: jsx tags don't get colored, but with the addition of types annotations getting colored.

Screenshots Tsx not working correctly image

Jsx working fine image

p00f commented 2 years ago

Type annotations not being highlighted is intended, not sure about the nested arrays in tsx though. Can you try out the issue_123 branch to see if the tsx tags are fixed

FernandoChu commented 2 years ago

Arrays are working correctly now, tsx tags are not though

p00f commented 2 years ago

This one should be fixed but extended mode in jsx doesn't work for some reason

Alex23rodriguez commented 2 years ago

is there a branch where this issue is fixed? I just updated the package and tsx files are now messed up for me

image

Gelio commented 2 years ago

@Alex23rodriguez This should be fixed by https://github.com/p00f/nvim-ts-rainbow/pull/125