emacssbt

(doom) emacs: lsp-mode not finding project root on sbt-start


I'm trying to run sbt-start with lsp-mode from within Doom Emacs from my Scala project, but when sbt starts up, it's in the home directory instead of where my build.sbt file is located. Has anyone experienced this before or does anyone know why this might be happening?

How do I specify to lsp-mode where the project root directory is?


Solution

  • Looks like the problem was that I had a project/ and target/ folder in my $HOME directory, and simply deleting them enables lsp-mode to find the right project root.

    Source: https://gitter.im/scalameta/metals?at=5c13d51d94d8cd0b9cc2e93f