py-script highlighting in PyCharm Professional

Hello, people! 

I've decided to try py-script. And PyCharm doesn't automatically highlight python code in <py-script></py-scrip>
Though it says it should on PyCharm website - https://www.jetbrains.com/help/pycharm/pyscript.html :

"PyCharm provides basic code completion and validation for Python code in an HTML file written using PyScript. "

Though my python code is just plain text 
Is there a way to fix it? I use the latest verison 


3 comments
Comment actions Permalink

Works correctly for me.

Does the issue reproduce in a new project? Please provide a sample of your HTML file.

1
Comment actions Permalink

Andrey Resler, sorry, got sick 
Don't know if I can send the file itself here somehow 

The code itself:


 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title><3</title>

<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css"/>
<script defer src="https://pyscript.net/latest/pyscript.js"></script>

<py-env>
- paths:
- ./eli.py
</py-env>

</head>



<body>


<b><3, say - <label id="hello"></label></b>

<py-script>

from eli import hullo

pyscript.write('hello', hullo())

</py-script>


</body>

</html>
0
Comment actions Permalink

Yes, the sample is straightforward and should work in 2022.2.2. Which version do you have? Please make sure the bundled PyScript plugin is enabled.

If it doesn't help, could you please provide idea.log file from the logs directory https://www.jetbrains.com/help/pycharm/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#logs-directory ?

0

Please sign in to leave a comment.