HiPhish / rainbow-delimiters.nvim

Rainbow delimiters for Neovim with Tree-sitter
https://gitlab.com/HiPhish/rainbow-delimiters.nvim
Apache License 2.0
465 stars 34 forks source link

feat: queries to highlight only jsx/tsx tags #77

Closed ribru17 closed 6 months ago

ribru17 commented 6 months ago

Hello and thanks for the awesome plugin! I only use it for lisp/HTML-like languages since I find the general bracket highlights a bit distracting. But I really wanted to be able to use them for the HTML parts of JSX/TSX, so I created this PR to add a query for only the React-style tags of these files, without the main highlighting. Feel free to change this PR if needed (maybe to move from the javascript directory to a new jsx directory? I wasn't sure if maybe this would add redundant queries when using an inherits modeline). Thanks!

HiPhish commented 6 months ago

Looks good, but I think rainbow-tags-react would be a better name. The -only suffix is redundant in my opinion, and putting tags before react fits better with rainbow-delimiters-react. What is your opinion?

ribru17 commented 6 months ago

Sounds good! I'll change it now

HiPhish commented 6 months ago

One more change please: the file queries/tsx/rainbow-tags-react.scm should not be a symlink, use a query which inherits from Javascript instead:

; inherits: javascript

;;; This query exists for people who only want to highlight tags without
;;; parentheses.

All the other queries inherit from Typescript, whose queries in return inherit from Javascript. Since there is nothing Typescript-specific here we can inherit straight from Javascript.

After you have made the change please squash your commits and rebase on the current master branch.

ribru17 commented 6 months ago

Got it, should be all good now. :+1:

HiPhish commented 6 months ago

Looks good now. Please squash one more time and I can merge.

ribru17 commented 6 months ago

Done. Also you may be interested in this page.

HiPhish commented 6 months ago

Merged, thank you.

Also you may be interested in this page.

Does that only apply to PRs merged through GitHub's web UI? I don't actually use GitHub for merging PRs, this repo is just a mirror. My workflow is to check out the PR locally and inspect it locally. Then I merge the feature branch into master locally and push to GitLab. GitLab then mirrors the changes to GitHub.

This way I am not tied to GitHub, but I still have the option of using it for collaboration because most people are on GitHub for better or for worse.

ribru17 commented 6 months ago

I see; I think you may be be able to do something like git merge --squash <branchname> but maybe at that point it would just be easier to have contributors squash beforehand.

HiPhish commented 6 months ago

I think Git changes the committer to myself if I git merge --squash myself. I'll have to try it the next time to see if that is really the case though.