benfry / processing4

Processing 4.x releases for Java 17
https://processing.org
Other
1.35k stars 237 forks source link

Code completion does not work on Linux #734

Closed shyimon closed 1 year ago

shyimon commented 1 year ago

Description

Code completion is not able to create the panel to show the suggestions

Expected Behavior

The panel opens with the relevant suggestions

Current Behavior

Nothing happens and the following error is logged in the console: java.lang.NullPointerException: Cannot invoke "javax.swing.ImageIcon.getIconWidth()" because "processing.mode.java.CompletionPanel.classIcon" is null at processing.mode.java.CompletionPanel.<init>(CompletionPanel.java:141) at processing.mode.java.JavaTextArea.showSuggestion(JavaTextArea.java:520) at processing.mode.java.JavaTextArea.lambda$fetchPhrase$0(JavaTextArea.java:332) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Steps to Reproduce

  1. Enable Code completion with Ctrl + Space in Preferences
  2. Type void setup() { backg
  3. Press Ctrl + Space
  4. See console for error log

Your Environment

benfry commented 1 year ago

Are you using the version from the Processing site (or the releases page here on GitHub), or one that was packaged by someone else?

manusaurio commented 1 year ago

I'm not a EndeavourOS user, but I do use Arch Linux and haven't had this problem, the auto completion feature works fine for me. I can tell it's not a Linux issue.

As far as I know EndeavourOS users also use the AUR repositories. My version of Processing is 4.2, its latest PKGBUILD on the AUR has OpenJDK 17 and ffmpeg as dependencies. The package makes sure Processing uses this version of Java and not the one set by archlinux-java, so it should work fine if Processing is being launched in a conventional way.

On the other hand, I've used the GitHub version (not the outdated one in the AUR) a few times within the present year and haven't had any issues like this either. I just tested it just in case and GitHub's works fine for me, I did the build with OpenJDK 17.0.7.

benfry commented 1 year ago

Ok, sounds like a bad package.