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

function keyword in javascript breaks highlighting the the succeeding paranthesis #122

Open
Nader-gator opened this issue Apr 21, 2019 · 8 comments

Comments

@Nader-gator
Copy link

Nader-gator commented Apr 21, 2019

The plugin works fine in all languages, but when I load javascript, none of the parenthesis inside a function definition are color. i use polyglot and when I disable javascript syntax highlighting(let g:polyglot_disabled = ['javascript'] ) and use the default neovim syntax mode it works fine. so I suspect this language pack that polyglot uses is the culprit but I can't figure out how to fix this. could it possibly be that the language pack is highlighting over the rainbow with its own rules?
Screen Shot 2019-04-21 at 1 24 16 PM
Screen Shot 2019-04-21 at 1 24 37 PM

edit: forgot to add, the same exact problem happens with ()=>{} syntax as well

luochen1990 added a commit that referenced this issue Apr 25, 2019
@luochen1990
Copy link
Owner

@Nader-gator will the branch fix-js-dft be helpful?

@Nader-gator
Copy link
Author

it fixed some but not all of the parenthesis and brackets. I fixed this issue myself by disabling some of the parenthesis syntax rules in vim polyglot that was preventing rainbow from highlighting the parentheses. I see that in your new commit you only added jsFuncBlock which fixes this issue with functions, but I believe to fix this issue across everything in JavaScript you need to add a lot more rules for the things that use brackets and parentheses (if statement, switch statement, etc.). regardless, I think the issue is more with the syntax rules from polyglot than it is with rainbow plugin

@docoder
Copy link

docoder commented May 8, 2019

same issue with vim-polyglot

@luochen1990
Copy link
Owner

Could you please follow this doc to try to solve this confliction?

@Nader-gator
Copy link
Author

I've made some modifications but theres still some bugs. I'll make a PR when its done probably in a couple of weeks

@nikinbaidar
Copy link

@Nader-gator will the branch fix-js-dft be helpful?

How do we add this in our vimrc?

@nikinbaidar
Copy link

I have had the same issue. when you use the function keyword, the highlighting just don't work

@mirsella
Copy link

mirsella commented Jan 3, 2021

a workaround for me was switching from vim-javascript to https://github.com/jelera/vim-javascript-syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants