IntelliJ IDEA: Python plugin doesn't highlight Python code

I have some problems with the IntelliJ IDEA Python plugin.

I have a Java project with several modules. And I want to add one module for Python scripts that I use to create some files.

I downloaded and installed the Python plugin (version 2.6.6.) For my IDEA (10.0.2 Ultimate). Then I added the Python SDK project to the project and created a new Python module. Then I added /src dir to this new module.

When I right-click on this module, I have a context menu item New → Python file . I can add my .py file to my module. I can also create Python Run / Debug Configuration. And IDEA can run my script. But IDEA does not highlight Python syntax. It marks a Python module with a Python icon, but my Python file is marked as a text file.

I checked all the settings, but I could not solve this problem. /src marked as "Source Folder" in the "Project Structure" dialog box.

+4
source share
1 answer

See Settings | File types , make sure that the .py extension is associated with the Python file type.

+11
source

Source: https://habr.com/ru/post/1339531/


All Articles