In PyCharm, is it possible to define custom rules for syntax highlighting for files, which combine syntax from two different languages?
A bit contrived example: following file should be treated as HTML, except for text in script tags, which should be treated as Python code.
<html>
<p></p>
<script type="text/python">
v = "something"
</script>
<br />
<script type="text/python">
print v
</python>
</html>
Bonus points for getting code completion to work as well.
Note that "IntelliLang" extension features don't fit, as in second block it wouldn't see variables declared in previous blocks.