[html-templating] easy way to inherite advanced html features
See original GitHub issueWith the vscode extension Better Jinja the jinja-html
language highlights jinja html templates, however some more advanced features available with the html
langauge are not working with jinja-html
:
- highlighting the opening tag when the cursor is in the closing tag (and visa versa) In the second case with
jinja-html
as the language alldiv
s are highlighted, not just the sibling of the tag under the cursor - auto creating the closing tag once the opening tag is created.
And 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
and extensions/html/language-configuration.json
into my extension but to no avail. I also tried looking through extensions/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 to jinja-html
the features above disappear.
- VSCode Version:
1.22.2 3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9 x64
- OS Version: ubuntu 18.04
Steps to Reproduce:
- install “Better Jinja”
- open or create a file with some html in
- change the language to
jinja-html
- try using advanced html features as described above
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)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:7 (4 by maintainers)
Top GitHub Comments
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 many thanks for your answer I created the PR at https://github.com/microsoft/vscode/pull/146731