-
Notifications
You must be signed in to change notification settings - Fork 32.4k
[html-templating] easy way to inherite advanced html features #49210
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
Comments
(Experimental duplicate detection) |
sorry, I think this is the same as #2915. There's a lot of noise there so I'm not really sure what the status is of this but I get the impression there's not much I can do at the moment. |
To correctly do tag highlighting you need language smarts such as a parser for your language. There is currently no easy way to easily add advanced HTML features to a template language. #47288 is about documenting the current state and give recommendations. |
When I used "Better Jinja", I also used "Auto Close Tag" extension to solve this problem. Please don't forget to edit settings.json by add "jinja-html" to "auto-close-tag.activationOnLanguage". |
@aeschli do you think if I create a pr to support my idea at #131531 (comment) could be acceptable? I know that it doesnt cover totally this issue but it will give the capability to have a custom language which extends html language features without extra efforts and it will work with language server written in java for instance. |
@angelozerr Yes, let's work on a PR for that. Can you start by opening a new one so we can discuss the approach in there? |
With the vscode extension Better Jinja the
jinja-html
language highlights jinja html templates, however some more advanced features available with thehtml
langauge are not working withjinja-html
:jinja-html
as the language alldiv
s are highlighted, not just the sibling of the tag under the cursorAnd probably more, but these are the two which would be most useful.
How do I get these advanced features working in my child language definition?
I've tried copying most of the config from
extensions/html/package.json
andextensions/html/language-configuration.json
into my extension but to no avail. I also tried looking throughextensions/html-language-features
but there's nothing obvious there to include.This isn't as simple as adding more file extensions somewhere, even in a
.html
file if the language is changed tojinja-html
the features above disappear.1.22.2 3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9 x64
Steps to Reproduce:
jinja-html
Does this issue occur when all extensions are disabled?: Yes (the advanced features work with the
html
language without extensions, obviously the error can only be shown with the extension installed)The text was updated successfully, but these errors were encountered: