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

prehook not working for jsx files #153

Closed
RyanzpLee opened this issue Apr 27, 2022 · 4 comments
Closed

prehook not working for jsx files #153

RyanzpLee opened this issue Apr 27, 2022 · 4 comments
Labels
invalid This doesn't seem right

Comments

@RyanzpLee
Copy link

I have added the prehook field into the setup, and I am following the instructions documented in the README and installed "JoosepAlviste/nvim-ts-context-commentstring"

However, when I am in a jsx file, and I try to comment out the html in the jsx, it only uses the // comment and does not wrap it in braces as expected. Here is the link to my plugins and here is the Comment.nvim setup

I'm not sure what I'm doing wrong, but I would love for this to work properly. Any help would be appreciated!
image

@numToStr
Copy link
Owner

Check whether calculate_commentstring() is returning the correct commentstring or not? It should be {/*%s*/}

@numToStr
Copy link
Owner

I am going to close this for now. If you face this again feel free to open it. Also, I am working on native jsx support, I'll appreciate it If you can give your feedback on it :)

@numToStr numToStr added the invalid This doesn't seem right label Apr 28, 2022
@RyanzpLee
Copy link
Author

I appreciate the help, I ended up using this configuration from the nvim-ts-util-context-commentstring repo and it's working great now.

Also native jsx support sounds fantastic. I love your plugin!

@bpingris
Copy link

bpingris commented Sep 1, 2022

Hey @RyanzpLee how did you manage to get this working?
I tried to follow the instructions mentionned in link you shared but it's still not working, I keep having // appended to jsx tags.

I took a look at your dotfiles and tried to copy/paste your config and reload neovim but it's still the same

Not really sure what I could be missing 🤔

My bad! As I was remaking my config I forgot I had to reinstall the treesitter's language! I reinstalled the missing ones and it's working now!
Please ignore my original message!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants