-
Notifications
You must be signed in to change notification settings - Fork 31
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
can't work in vscode(1.16.1) #19
Comments
Same problem here ... |
same here Welcome to my blog {{ name }}{% endblock %}` |
When the extension originally shipped, it could handle mixed languages with problem. Along the way, somewhere around version 1.4, they changed how languages where loaded/used in the editor and broke existing installs of this extension. The change made it easier to introduce mixed languages, but only if your language within a closure of the parent language in the page - like CSS or JS within an HTML page. The page will always start with HTML elements, but the same is not true for Jinja, where it could be the root/parent language or a child language. There is a very costly way of getting around this by rewriting the extension and creating custom language files for each language that could be used with Jinja, or even writing a language service for Jinja that somehow hands off to other language services for things that aren't part of Jinja (assuming there even is a language service for the other language). Or just wait for the Visual Studio Code team to change/fix the mixed language logic. I'm not the only one with this issue, there are other template-type languages that need the same components I do, but until Code moves away from strictly using the Textmate logic, I'm not going to be able to fix the extension to be the way it should be. I just don't have the time for it. See microsoft/vscode#670 about just mixing PHP and HTML, which is a far more popular language mix than Jinja + anything has been around since 2015. I use Jinja almost everyday with Ansible templates, so I'm personally impacted by this issue myself, so I'm in the same boat as all of you. For the time being, I've been using JetBrain's PyCharm, which has a free community edition that doesn't have this language mix issue. If they fix the issue, I'll be all over it trying to get this extension to work again. Until then, this is a Jinja only plugin that is not guaranteed to work in any mixed language scenarios. |
I've found another plugin (Better Jinja) that doesn't have this issue - https://github.com/samuelcolvin/jinjahtml-vscode . It seems to be in a more active development as well. |
See also microsoft/vscode#40285 |
it only syntax highlighting for jinja not for html.
but another plugin Django Template is ok.
The text was updated successfully, but these errors were encountered: