The PyCharm parses is complaining about all the colons in my Django template:
The error message it gives is "Expected }}".
This started happening after I created a separate project that has jinja2 templates. That is, it was working fine before, but is now complaining about those colons. So, it is probably something I did to the settings.
I do have the Python Template Language set to Django:
I don't know what else to check.
I just noticed, that the icon next to testfile.html is "J2". This should be HTML. I think the problem is that changing the template language back to Django is not doing anything. PyCharm still thinks it is a jinja2 template. Any help?
Related
When I am editing a file with the Vue extension in VS Code I do not get Syle intellisense in the HTML. If I change the Language Mode to HTML then it works but I no longer get Vue intellisense.
Is there a way to make this work in a Vue file?
Absolutely, you can install the following extension: Vetur. It has great features like linting, formatting, snippets and of course syntax highlighting.
I'm using spring boot and thymeleaf in Intellij Idea and try to get the parameters of the URL in the template, I use the following code:
<!--/*#thymesVar id="param" type="java.util.Map<java.lang.String, java.lang.String>"*/-->
<a th:href="#{/dashboard(version=${param.version})}">Dashboard</a>
It works correctly, but I want to clear the error message, Is there any good way to do this?
This is not an error. If you run your application, It is supposed to work (If there is no other errors), as you mentioned that It's working correctly. The JetBrains/ IntelliJ is not able to locate your model variables with Thymeleaf framework. So that's why I does show the red underline. For more details check the link how to resolve JetBrains model variables.
Hopefully in next version of IntelliJ IDEA, this issue would get resolved.
Let us know If It was helpful.
I am trying to make a syntax highlighting for Vue.js. But it does not work with :attr, at all.
(?!v-for)(v-.*) and #[a-z].* works as well. But this does not work even like
\ automatically deleted after saving
Don't need anymore. Now it officialy supported in new phpstorm/webstorm.
I just tried to use HAML in my django project, which works fine^^
But while writing beautiful HAML code PyCharm refuse to offer any code completion or syntax highlighting for django template tags like in HTML files.
Do I need to configure PyCharm differently or is it just not possible to get the "Django Support" in HAML files with PyCharm?
Thanks in advance
I've found an older issue related to this one.
"At the moment the HAML support is part of the RubyMine code and can't be
used in other products. We have an issue for making it independent:
http://youtrack.jetbrains.net/issue/RUBY-6432"
Not sure if they managed to extract the HAML support to PyCharm or not. Their tracker is overloaded so I couldn't check it.
I just installed the recently released Intellij IDEA 12, which is GREAT for Play Framework 2.
However, I'm having the following issue: in an HTML Scala template, any JavaScript code enclosed in a <script> tag within the body of the template is not recognised as JavaScript by IDEA, thus not offering code completion and incorrectly showing errors where they aren't. I suspect it is interpreting the code as Scala code, ergo offering incorrect code completion and making it quite painful to write JS in a template.
This issue was not present in IDEA 11.
Any ideas?
Update
I have the JavaScript Support plugin enabled. Simple code completion works fine. However, if I type function (){} to code an anonymous function and hit Enter with the caret between the curly brackets, IDEA does the following:
If I manually fix the incorrectly added }, and write code for the anonymous function, it offers correct variable suggestion for the console.log although it is stil showing errors:
I can't confirm that, I can see that both, Scala and JavaScript completion works properly.
Go to Settings > Plugins and make sure that you have JavaScript Support enabled. After that close and reopen all your views to let the Idea analize syntax once again.
It appears that your function statement is invalid because you did not name your function. The details of what is going on here are answered in this post. I'm not sure of the details of your particular needs, but you might try this syntax instead:
<script>
(function() {
})();
</script>