refactor!(java): remove +eclim and +meghanada

BREAKING CHANGE: This removes eclim.el and meghanada.el support from the
Java module. Both of these projects are unmaintained and recommend the
user switch to lsp-java, which is already offered by the module's +lsp
flag.

Fix: #8360
This commit is contained in:
Henrik Lissner
2025-04-15 04:54:22 -04:00
parent 46647dada6
commit 88b6d35082
5 changed files with 5 additions and 127 deletions

View File

@ -1,50 +0,0 @@
;;; lang/java/+eclim.el -*- lexical-binding: t; -*-
;;;###if (modulep! +eclim)
;; NOTE This submodule is incomplete
(use-package! eclim
:hook (java-mode . eclim-mode)
:config
(set-lookup-handlers! 'java-mode
:definition #'eclim-java-find-declaration
:references #'eclim-java-find-references
:documentation #'eclim-java-show-documentation-for-current-element)
(require 'eclimd)
(setq help-at-pt-display-when-idle t
help-at-pt-timer-delay 0.1)
(help-at-pt-set-timer)
(map! :localleader
:map java-mode-map
(:prefix ("r" . "refactor")
"gc" #'eclim-java-constructor
"gg" #'eclim-java-generate-getter-and-setter
"oi" #'eclim-java-import-organize
"f" #'eclim-java-format
"r" #'eclim-java-refactor-rename-symbol-at-point)
(:prefix ("h" . "help")
"." #'eclim-java-show-documentation-for-current-element
"r" #'eclim-java-find-references
"c" #'eclim-java-call-hierarchy
"h" #'eclim-java-hierarchy
"p" #'eclim-problems
"r" #'meghanada-reference
"t" #'meghanada-typeinfo)
(:prefix ("b" . "build")
"b" #'eclim-project-build
"c" #'eclim-project-create
"d" #'eclim-project-delete
"g" #'eclim-project-goto
"i" #'eclim-project-import
"k" #'eclim-project-close
"o" #'eclim-project-open
"u" #'eclim-project-update)))
(use-package! company-emacs-eclim
:when (modulep! :completion company)
:after java-mode
:config
(set-company-backend! 'java-mode '(company-emacs-eclim)))

View File

@ -1,39 +0,0 @@
;;; lang/java/+meghanada.el -*- lexical-binding: t; -*-
;;;###if (modulep! +meghanada)
(use-package! meghanada
:hook (java-mode-local-vars . meghanada-mode)
:init
(setq meghanada-server-install-dir (concat doom-data-dir "meghanada-server/")
meghanada-use-company (modulep! :completion company)
meghanada-use-flycheck (or (modulep! :checkers syntax +flymake)
(not (modulep! :checkers syntax)))
meghanada-use-eldoc t
meghanada-use-auto-start t)
:config
(set-lookup-handlers! 'java-mode
:definition #'meghanada-jump-declaration
:references #'meghanada-reference)
(defadvice! +java-meghanada-fail-gracefully-a (fn &rest args)
"Toggle `meghanada-mode'. Fail gracefully if java is unavailable."
:around #'meghanada-mode
(if (executable-find meghanada-java-path)
(apply fn args)
(message "Can't find %S binary. Is java installed? Aborting `meghanada-mode'."
meghanada-java-path)))
(map! :localleader
:map java-mode-map
(:prefix ("r" . "refactor")
"ia" #'meghanada-import-all
"io" #'meghanada-optimize-import
"l" #'meghanada-local-variable
"f" #'meghanada-code-beautify)
(:prefix ("h" . "help")
"r" #'meghanada-reference
"t" #'meghanada-typeinfo)
(:prefix ("b" . "build")
"f" #'meghanada-compile-file
"p" #'meghanada-compile-project)))

View File

@ -12,10 +12,8 @@ This module adds [[https://www.java.com][Java]] support to Doom Emacs, including
** Module flags
- +lsp ::
Enable LSP support for ~java-mode~. Requires [[doom-module::tools lsp]] and a langserver
(supports eclipse.jdt.ls). *Incompatible with [[doom-module:+meghanada]].*
- +meghanada ::
Enable [[doom-package:meghanada-mode]]. *Incompatible with [[doom-module:+lsp]].*
Enable LSP support for ~java-mode~. Requires [[doom-module::tools lsp]] and a
langserver (supports eclipse.jdt.ls).
- +tree-sitter ::
Leverages tree-sitter for better syntax highlighting and structural text
editing. Requires [[doom-module::tools tree-sitter]].
@ -23,10 +21,6 @@ This module adds [[https://www.java.com][Java]] support to Doom Emacs, including
** Packages
- [[doom-package:android-mode]]
- [[doom-package:groovy-mode]]
- [[doom-package:meghanada]] if [[doom-module:+meghanada]]
- if [[doom-module:+eclim]]
- [[doom-package:eclim]]
- [[doom-package:company-emacs-eclim]] if [[doom-module::completion company]]
- if [[doom-module:+lsp]] and not [[doom-module::tools lsp +eglot]]
- [[doom-package:lsp-java]]
@ -99,7 +93,6 @@ And then run ~$ direnv allow .~ in the project directory. The [[doom-module::too
module will automatically source this environment before activating LSP servers.
** Formatter
[[doom-module::editor format]] uses [[https://github.com/google/google-java-format][google-java-format]] to handle formatting.
To install, grab the latest =all-deps.jar= release from the above, put it
@ -134,24 +127,6 @@ According to [[https://github.com/emacs-lsp/lsp-java]], you get:
- Project explorer integration ([[doom-package:treemacs]])
- Integration with [[https://start.spring.io/][Spring Initializr]]
** =+meghanada= features
According to [[https://github.com/mopemope/meghanada-emacs/]], you get:
- Auto-update server module
- [[https://gradle.org/][Gradle]] and [[http://maven.apache.org/][Maven]] and Eclipse project support
- No need build tool's plugin
- Run build tool task
- Compile your project
- Syntax check and analyze java source ([[doom-package:flycheck-meghanada]])
- Support =Generic Types=
- Code completion with [[doom-package:company-mode]] ([[doom-package:company-meghanada]])
- Optimize import and sort
- Jump declaration
- Run [[http://www.junit.org/][JUnit]] test (include test runner)
- Diagnostic reporting with [[doom-package:flycheck]] ([[doom-package:flycheck-meghanada]])
- Show symbol's type info with [[doom-package:eldoc]]
- Search references
- Full-featured text search
* TODO Configuration
#+begin_quote
󱌣 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]

View File

@ -26,9 +26,9 @@ If the depth is 2, the first two directories are removed: net.lissner.game.")
(add-hook 'java-mode-hook #'rainbow-delimiters-mode)
(cond ((modulep! +meghanada) (load! "+meghanada"))
((modulep! :tools lsp +eglot))
((modulep! +lsp) (load! "+lsp")))
(when (and (modulep! +lsp)
(modulep! :tools lsp -eglot))
(load! "+lsp"))
(when (modulep! +tree-sitter)
(add-hook 'java-mode-local-vars-hook #'tree-sitter! 'append))

View File

@ -4,14 +4,6 @@
(package! android-mode :pin "67f7c0d7d37605efc7f055b76d731556861c3eb9")
(package! groovy-mode :pin "7b8520b2e2d3ab1d62b35c426e17ac25ed0120bb")
(when (modulep! +meghanada)
(package! meghanada :pin "fb29746e442e3d7b903759d15977d142a4bf2131"))
(when (modulep! +eclim)
(package! eclim :pin "222ddd48fcf0ee01592dec77c58e0cf3f2ea1100")
(when (modulep! :completion company)
(package! company-emacs-eclim :pin "222ddd48fcf0ee01592dec77c58e0cf3f2ea1100")))
(when (modulep! +lsp)
(unless (modulep! :tools lsp +eglot)
;; HACK: lsp-java depends on lsp-treemacs without declaring it as a