Remove the need for nvim/nvim-lspconfig #37
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I still need to clean up a few things and pretty much replace all of the documentation/readme, but this is the approach that I'd like to take. To summarize, this pr will get rid of the need for a user to have
nvim/lsp-config
installed. They still can if they want to, but this should become the preferred way to use Metals with nvim lsp mainly because of all the extra functionality and Metals-specific lsp extensions it provides. The main idea is that instead of having a user add in a bunch of handlers on their own and also have to keep adding them in as we add them, is for them to simply have the following:This will basically provide all of the functionality that
nvim/nvim-lspconfig
and this extension provided before, but with way less work to setup. However, this still remains very customizable. For example, my personal setup locally looks like this:This allows me to use the
on_attatch()
from nvim-completions, change the defaultshow-message
toon
to be able to usemetals/status
, and also customize how my diagnostics look.This plugin also will fully handle the installation of Metals for the user by providing a
:MetalsInstall
command to put Metals in a specific location and use it. I've tried to be quite descriptive with messages to help the user know what's going on.I still have some further things to do, but this will at least give an idea of the direction I'm headed.
@landerlo feel free to take a peak at this and give me any feedback.
TODO
:MetalsInfo
command to give some practical info, basically the output ofmetals --version
which shows the version of metals and also the supported Scala Versions. This command can also be used to show where Metals is installedset shortmess-=F
. This needs to be set in order for the FileType autocmd to displayprint
, which is needed for the helpful messages.