This is a great question and has been the subject of much discussion and research going as far back as the mid-2000s. I’ll quote Processing’s principal maintainer Ben Fry on the topic:
The current Editor, based on the ancient JEditSyntax package has held up long past its expiration date. Exhaustive work has been done to look at replacing the component with something more modern, like
RSyntaxArea
, but it’s simply not feasible without breaking a massive amount of code, and likely introducing a lot of regressions in the process. All for… code folding? An incrementally better experience? But with potential for major setbacks in low-level code? It’s simply not a path that makes sense.With that in mind, any work on updating the editor and adding new features should be focused on further adapting the preprocessor and compiler to be wrapped using the Language Server Protocol, so that we can link to other existing editors (Visual Studio Code and many others). It should be possible to create a Java-only, headless implementation that wraps the current source in this repository and can communicate via LSP.
The initial work was completed in Processing 4.1, and now needs more testing and implementation of Language Server clients such as this one.
We can start building a new PDE that’s as simple to use as the current application, based on something like Theia, a new editor platform that uses LSP as its basis.
With that in mind, nearly all editor enhancement requests will be redirected to this aim. The current editor does what we want it to, for the intended audience, and improving it requires a better foundation as a starting point.
Source: https://github.com/benfry/processing4/blob/main/CONTRIBUTING.md#editor
For a deeper understanding of the topic I highly recommend reading the following documentation:
- Why upgrading Processing’s current code editor is a bad idea
- Ben’s to do list for rebuilding the PDE
TL;DR:
“The bottom line is that the time is better spent pursuing a different approach—a Language Server implementation and probably a lightweight (HTML/JS) GUI on top of it.” — Ben Fry