Closed olafurpg closed 5 years ago
Would someone be able to help out with this? I've spent a couple hours trying to get lsp-scala working on my computer but I've never used Emacs before so it's all new to me.
vim.md
as a base templateThe benefit of documenting the Emacs installation on the Metals website is that version numbers for generating the metals-emacs
binary will stay up-to-date as new releases are published.
cc/ @coreyoconnor
Alternatively, if someone can give me a pointers on how to get started from a completely clean ~/.emacs.d
then I'd love to give it another try myself. I struggled most with installing packages.
I wrote extensive Learning Emacs docs over at
that you may wish to use for your own benefit.
@fommil thanks, I got it working!
Whoops, fat thumb closed the issue while I was writing a response.
It's a little more burdensome than it ought to be because the package isn't in MELPA yet, like its dependency. I did some of the ceremonial linting to get it up to standard. I'll try to submit it to MELPA today.
I like how Emacs highlights the line that you navigate to
I'll open a PR soon updating the docs. The integration is not perfect yet, I can't get lsp-mode to send the correct shutdown
and exit
hooks. It also sends textDocument/hover
requests even if Metals does not declare a hover provider. Those can be improved on in the future.
@rossabaker would it be possible to enable the hook by default?
(add-hook 'scala-mode-hook #'lsp-scala-enable)
I'm not aware of another editor that require enabling the language server on a file-basis. It's more common to disable/enable the LSP package on per-project.
@rossabaker what do you mean "like its dependency"? https://melpa.org/#/lsp-mode
@olafurpg btw, just so you know, the red squiggly support is already provided, (non-ensime) emacs by sbt's lsp and/or flycheck. I suspect the docs may need to touch on disabling things or everybody is going to get conflicts and perf regressions. Spacemacs often enables stuff by default.
That's a very good point, We do the same for VSCode's docs, for other available Scala LSP extensions, so it makes sense for Emacs too.
I would love to update the website to document the installation instructions for Emacs using lsp-scala (https://github.com/rossabaker/lsp-scala/). I've been planning to do this for awhile but I have limited experience with Emacs so I got stuck on my first attempt and never got around to finish it.
cc/ @rossabaker