I have installed lsp-mode, lip-scala, lsp-ui, company-lsp and many other packages. When entering scala code, I often get popups to complete the method/class/variable name, which also add the relevant imports if needed.

However, this does not always happen. I am new to lip-mode, so I am not sure how to debug what is going wrong. What are useful commands/settings to figure out what is going wrong when it is not working?

I have configured it with

;; lsp configuration
(use-package lsp-scala
  :after scala-mode
  :demand t
  ;; Optional - enable lsp-scala automatically in scala files
  :hook (scala-mode . lsp))

There are lots of messages in *lsp-log* but none of them indicate any obvious to me.

1 Answer 1


lsp-scala is deprecated and you should now use lsp-mode which has scala support via metals. From the lsp-scala repo:

lsp-scala is now part of lsp-mode as lsp-metals. Please do not use this package.

I would suggest referring to the metals documentation which can help you with installation: https://scalameta.org/metals/docs/editors/emacs.html (make sure you uninstal lsp-scala first).

Useful command for debugging

What I usually do when something is not working is setting (debug-on-error t), this will throw you into a debugger when there is an error and will enable you to start investigating where something went wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.