-
Notifications
You must be signed in to change notification settings - Fork 34
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
Support for HTMLDjango with Non-Nested Language Option #92
Conversation
There is an existing pull request for JoosepAlviste/nvim-ts-context-commentstring#92 But the author seems to have ignored it and is not likely to get merged at some point in the future. This is just a simple fix for this to just use our custom commentstring_override which is defined within the after/ftplugin/htmldjango.lua before even trying to calculate which commentstring to use. I tried overriding the vim.bo.commentstring but calculate_commentstring ignores it.
Hi! @JoosepAlviste, any reason for not accepting this MR? I've just tested it and it seems to work. It's very important for Django templates. |
Hey! To be honest, I have kind of forgotten about this PR 😅 Thanks for the ping! I can definitely see that we should handle the Django templates correctly. At first glance, it seemed like having a If I understand it correctly, then we want to absolutely ignore any |
It happens. 😝
I'm not sure about that... The thing I like about |
I agree that I prefer to comment everything with While this solution works for me, I understand that having a configuration option specific to one file type might not be the best approach. Perhaps other template dialects could benefit from a similar option in the future. |
Let's merge this! I can't think of a better solution and this is pretty OK anyways. Added a couple comments and the formatting check is also not passing. Once those things are fixed, then we can merge 👍 |
Co-authored-by: Joosep Alviste <[email protected]>
Thanks for the contribution! 🎉 |
Thank you for merging! I really appreciate your work on this project! |
This pull request introduces support for comments in the HTMLDjango template language. While the detection of nested languages and formatting comments accordingly is generally advantageous, there are cases where it may be counterproductive, especially in file types like HTMLDjango templates.
In HTMLDjango templates, it is preferable to utilize Django template comments not only within HTML but also in JavaScript and CSS. These comments effectively exclude code from rendering and prove beneficial. The proposed change becomes essential for commenting on template control statements, addressing a limitation in the existing functionality.
Please review and consider merging this pull request to enhance the plugin's compatibility with HTMLDjango templates.