1

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?

2
  • You can suppress this particular unresolved reference error from alt+enter menu, but I suggest submitting an issue to youtrack.jetbrains.com/issues as this is either a bug or a missing feature. Commented Jul 29, 2020 at 20:44
  • @AndreyResler I really hate suppressing errors. Commented Jul 29, 2020 at 21:01

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.