The full backtrace:
Debugger entered--Lisp error: (wrong-number-of-arguments (4 . 4) 3)
lsp--make-stdio-connection("lsp-java" ("java" "-Declipse.application=org.eclipse.jdt.ls.core.id1" "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044" "-Dosgi.bundles.defaultStartLevel=4" "-Declipse.product=org.eclipse.jdt.ls.core.product" "-Dlog.protocol=true" "-Dlog.level=ALL" "-noverify" "-Xmx1G" "-jar" "/Users/lukertty/.emacs.d/.26.0.90-cache/jdt-language-server-0.11.0-201801040110/plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar" "-configuration" "/Users/lukertty/.emacs.d/.26.0.90-cache/jdt-language-server-0.11.0-201801040110/config_mac" "-data" "/Users/lukertty/Documents/draft/develop/") nil)
lsp-java-enable()
run-hooks(change-major-mode-after-body-hook prog-mode-hook c-mode-common-hook java-mode-hook)
apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook c-mode-common-hook java-mode-hook))
run-mode-hooks(java-mode-hook)
java-mode()
set-auto-mode-0(java-mode nil)
set-auto-mode()
normal-mode(t)
after-find-file(nil t)
find-file-noselect-1(#<buffer FlexflowApplication.java> "~/Documents/draft/develop/src/main/java/com/sucsoft/flexflow/FlexflowApplication.java" nil nil "~/Documents/draft/develop/src/main/java/com/sucsoft/flexflow/FlexflowApplication.java" (15661731 16777220))
find-file-noselect("/Users/lukertty/Documents/draft/develop/src/main/java/com/sucsoft/flexflow/FlexflowApplication.java" nil nil nil)
find-file("/Users/lukertty/Documents/draft/develop/src/main/java/com/sucsoft/flexflow/FlexflowApplication.java")
dnd-open-local-file("file:/Users/lukertty/Documents/draft/develop/src/main/java/com/sucsoft/flexflow/FlexflowApplication.java" private)
dnd-handle-one-url(#<window 3 on *scratch*> private "file:/Users/lukertty/Documents/draft/develop/src/main/java/com/sucsoft/flexflow/FlexflowApplication.java")
ns-drag-n-drop((drag-n-drop (#<window 3 on *scratch*> 146 (474 . 361) 1149179922 nil 146 (67 . 3) nil (474 . 319) (7 . 14)) (file "/Users/lukertty/Documents/draft/develop/src/main/java/com/sucsoft/flexflow/FlexflowApplication.java")))
funcall-interactively(ns-drag-n-drop (drag-n-drop (#<window 3 on *scratch*> 146 (474 . 361) 1149179922 nil 146 (67 . 3) nil (474 . 319) (7 . 14)) (file "/Users/lukertty/Documents/draft/develop/src/main/java/com/sucsoft/flexflow/FlexflowApplication.java")))
call-interactively(ns-drag-n-drop nil nil)
command-execute(ns-drag-n-drop)
To reproduce:
emacs -Q -l '~/.emacs.d/lisp/lsp-test.el'
lsp-test.el:
(setq user-emacs-directory "~/.emacs.d" package-user-dir (expand-file-name (concat "elpa-" emacs-version) user-emacs-directory))
(defvar user-config-dir (expand-file-name "lisp" user-emacs-directory))
(add-to-list 'load-path user-config-dir)
(package-initialize)
(eval-and-compile (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)))
(eval-when-compile (require 'use-package))
(require 'bind-key)
(setq use-package-verbose t use-package-always-ensure t use-package-always-defer t)
(use-package diminish)
(toggle-debug-on-quit) (toggle-debug-on-error)
(use-package lsp-mode)
(use-package lsp-ui)
(use-package projectile)
(use-package company-lsp
:config
(push 'company-lsp company-backends)
(setq company-lsp-async t)
(setq company-lsp-enable-snippet t)
(setq company-lsp-cache-candidates t))
(use-package lsp-java
:init (setq lsp-java-server-install-dir "~/.emacs.d/.26.0.90-cache/jdt-language-server-0.11.0-201801040110"))
(require 'projectile)
(with-eval-after-load 'lsp-mode (require 'lsp-flycheck))
(require 'lsp-mode)
(require 'lsp-ui)
(add-hook 'lsp-mode-hook 'lsp-ui-mode)
(require 'lsp-java)
(require 'company-lsp)
(add-hook 'java-mode-hook #'lsp-java-enable)
I also have this problem for _javascript-typescript_. I had to disable lsp-mode entirely in order to be able to work.
I had the same issue but solved it by removing and adding the package again. I suspect it is an issue with old byte-compiled version. I had this issue with javascript, python, rust and java lsp packages.
@terlar 's solution works.
Yeah, this was due to a backward incompatible API change to lsp-mode.
Reinstalling the package should fix it.
On 08-Jan-2018 2:27 PM, "caisah" notifications@github.com wrote:
@terlar https://github.com/terlar 's solution works.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/emacs-lsp/lsp-mode/issues/228#issuecomment-355911472,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACCymAhGD4tecMkvt7Ja7JkmZuVbA3_eks5tIdiHgaJpZM4RV3_J
.
I used this technique to re-compile everything:
M-: (byte-recompile-directory package-user-dir nil 'force)
Most helpful comment
I had the same issue but solved it by removing and adding the package again. I suspect it is an issue with old byte-compiled version. I had this issue with javascript, python, rust and java lsp packages.