-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Doesn't close tags in XML #163
Comments
Having the same issue. Works for HTML but not XML. |
The XML treesitter parser had its starting and end tags changed recently it seems. The new start and end tags for XML are This patch fixes the auto closing at least: diff --git a/lua/nvim-ts-autotag/internal.lua b/lua/nvim-ts-autotag/internal.lua
index 89bea74..25a3b46 100644
--- a/lua/nvim-ts-autotag/internal.lua
+++ b/lua/nvim-ts-autotag/internal.lua
@@ -34,10 +34,10 @@ local HTML_TAG = {
'php',
'xml',
},
- start_tag_pattern = { 'start_tag' },
- start_name_tag_pattern = { 'tag_name' },
- end_tag_pattern = { 'end_tag' },
- end_name_tag_pattern = { 'tag_name' },
+ start_tag_pattern = { 'start_tag', 'STag' },
+ start_name_tag_pattern = { 'tag_name', 'Name' },
+ end_tag_pattern = { 'end_tag', 'ETag' },
+ end_name_tag_pattern = { 'tag_name', 'Name' },
close_tag_pattern = { 'erroneous_end_tag' },
close_name_tag_pattern = { 'erroneous_end_tag_name' },
element_tag = { 'element' }, Not sure if there's anything else missing from the new TS stuff, I haven't checked yet. If someone wants to PR this feel free -- otherwise I'll PR this later today or tomorrow. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@PriceHiller will you be able to get the above PR merged? |
If my PR is looked at, then yes. As far as I can tell my patch works as expected. I'll ping on the PR to windwp. He may have missed this/lacked time to really look. If it doesn't get looked at then I'll probably end up maintaining some small patches and whatnot on my fork as I encounter bugs. |
Unfortunately it appears @windwp hasn't responded to my ping in a week in any way. For anyone interested (like @jonathanmorris180), I'll be maintaining a fork over @ https://github.com/PriceHiller/nvim-ts-autotag/ with some of the PRs open here merged later today until such a time where @windwp is able to continue working on this plugin. I hope they're doing ok. Once (or if) they come back, I'll look into merging my fork back here. Please ping me when you're back @windwp, the plugin kicks ass and life sometimes hits hard. No problem if you're gone for a bit, it's a free plugin after all 😉. |
Will be closed by #173 |
Resolved by #173. Please do not use my fork anymore -- this repository is still being maintained by windwp and I am also now a maintainer assisting them. If XML tags still don't work, ping me and I'll reopen and investigate, thanks! |
Thanks for your work on this plugin!
I've been trying to get the auto-closing to work for xml files (this is important for Java projects since working with the POM can be a pain otherwise) but it doesn't seem to work. Here is my nvim-treesitter config.
Please let me know if more info is needed.
The text was updated successfully, but these errors were encountered: