Hi again.
It's been a while. The hacky auto-complete solution I mentioned in my last email is working fairly well for me at work, although it does require some effort to fill it in with autocomplete entries.
I recently had a go at using emacs. While I did appreciate the LSP-based autocomplete and some other fancy features, I just can't get around emacs's bloody awful choice of key bindings. Any time I try to use anything other than Evergreen, I just end up coming back again because nothing else seems to allow me to navigate code anywhere near as easily.
So I had another look at the situation with LSPs. It turns out that Google's been nice and released a JSON lib (called 'gson'), and the Eclipse foundation have also been nice and released a "jsonrpc" lib (which builds on gson), and an LSP lib (which uses their "jsonrpc" lib). The result is a really quite usable API.
I managed to hack enough dodgy code into the PTextAreaDemo to prove the concept of using it to generate auto-completions, and I've just spent today implementing it semi-properly in Evergreen itself. It's not submitted yet, and doesn't work quite correctly, but fundamentally this looks very doable, and I think I'll have something working this weekend or next.
There are a couple of questions I have yet to answer; if anyone has strong feelings please let me know. Err, and also please shout if you're actually using Evergreen - I do wonder if I'm the only person on the planet to be doing so.
1: Do we still want to keep the JavaResearcher that provides the existing autocomplete? Or should we just go the LSP-only route for that? If the latter, any ideas as to a good LSP for Java that will work with the Evergreen codebase? I tried 'jdtls', and it complains that nothing's in a workspace and so it won't provide any useful features (I think it's looking for some build system it supports, like gradle or maven or something).
2: I'm considering refactoring the PTextArea a little. Currently PTextBuffer has the raw bytes, but the PTextArea also has both the PLineList (handling the real line structure of the file) *and* the SplitLine stuff, which handles wrapping and is dependent on the width of the PTextArea component. I would like to add both multiple column, and multiple-views-for-one-file support. This would mean we'd want to have the split lines still associated with the PTextArea component, but the PLineList is probably best shared. I'm wondering whether to move the PLineList down into the PTextBuffer, or add an extra component between PTA and PTB. I've not looked into the practicalities of either yet.
3: I started using Sway some time ago (tiling window manager). The auto-complete results list, which is supposed to appear as an undecorated white window right next to the cursor, is actually being turned into a full-scale window, which causes everything else to be shifted about when it opens and closes. I'm wondering whether to try to fix that as it is, or rather to change the 'ctags' thing into an EColumn (although a separate one per workspace) which can contain the ctags along with other stuff. Other stuff could include "open quickly" and "find in files" results, autocomplete results, and the output of running processes (+Errors window - I think we used to have that). This might be a better use of space on modern-sized monitors, and would work better with tiled window managers. Any thoughts on this would be really helpful.
Cheers,
Phil