-
Notifications
You must be signed in to change notification settings - Fork 3
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
bug when used with classnames package #1
Comments
It does look like using treesitter fixes the issue; however, I haven't been using treesitter because it causes some problems that are unrelated to your plugin. Would any of the regexes mentioned in this PR help? |
I used the wrong github account for those replies.... here they are for context.
@kyle-mccarthy Treesitter is just a parser. It won't cause you any problems to have the parser installed. You don't have to use the any highlighting or any other plugins that use treesitter. You just need the parser for your language installed. I think the problem here is how it calculates the range to replace... the new line is messing it up. |
Is there a new line? I think that it just wraps currently without inserting a line break. Also to preface this, I know this isn't the right place for me get treesitter assistance but I want to explain why I haven't enabled it. My main problems with treesitter are errors when editing a file with a language (like vim) that doesn't have a parser, also, for some unknown reason, saving a file takes longer with treesitter enabled, and saving a file intermittently triggers an error and writes I haven't had the time to debug the errors further though, but since treesitter didn't exactly work out of the box I haven't been using it. |
@kyle-mccarthy You don't have to enable any highlighting module for treesitter. You can just install the parser and this plugin will use it. Treesitter does nothing on it's own. It's just an api for plugins to use. I recommend just installing the nvim-treesitter plugin and installing the parser for javascript (or typescript). You don't even need to setup the nvim-treesitter plugin. It's purely just for compiling the parser. |
Also, I think it's treating the function call as a class and that's why it's messing it up. |
I have a typescript file that contains a react component and one of HTML elements uses the classnames utility to manage the element's classNames property. When trying to save the component + headwind.nvim resorts the classnames, it outputs invalid JSX. (see gif)
BTW thanks for this plugin! All the existing headwind integrations are outdated and don't work with Tailwind 2 or JIT.
The text was updated successfully, but these errors were encountered: