Peter M
Peter M

Reputation: 7503

Intellij Python plugin syntax highlighting of Java class import in Jython

I'm using the latest IntelliJ IDEA Community IDE with the latest Python plugin to edit Jython code. In the IDE I can edit and run pure Python code using the Jython runtime installed on the machine.

However when I import a java class, the IntelliJ IDE marks the elements in the import statement as "unresolved references". But the code itself correctly runs.

enter image description here

Is there anyway to convince the IntelliJ syntax highlighting that this is valid Jython code?

Upvotes: 1

Views: 368

Answers (1)

Peter M
Peter M

Reputation: 7503

One solution to my issue was to install the Jython Helper plugin (also on Github). This plugin creates stub files for any Java class that is referenced by a Jython program. Once the stub files are created then the red lines go away. But as I have already proved, the red lines are not an impediment to actually running the code.

Note that I am not associated with this plugin, I only discovered it after posting my question.

Upvotes: 0

Related Questions