eglot-java icon indicating copy to clipboard operation
eglot-java copied to clipboard

Fix updating eglot-sever-programs when multiple java-related assocs e…

Open heinzfridolin opened this issue 3 months ago • 1 comments

As it is the eglot-java--init function messes up eglot-server-programs when multiple java-related assocs exist. For example when it contains two elements with a car of '(java-mode java-ts-mode) because the user previously used add-to-list, then the first one would become '(java-mode java-ts-mode java-mode java-ts-mode) and eventually even self reference and throw an error.

The problem is caused by mapcan which is destructive because of nconc. Just altering the first match suffices anyways, so we can use cl-find-if instead.

In my case the error often had the effect of eglot-java seemingly initalizing but the eglot-java-eclipse-jdt server not actually existing, so https://github.com/yveszoundi/eglot-java/issues/56 might be fixed.

heinzfridolin avatar Oct 12 '25 13:10 heinzfridolin