williamboman / mason.nvim

Portable package manager for Neovim that runs everywhere Neovim runs. Easily install and manage LSP servers, DAP servers, linters, and formatters.
Apache License 2.0
7.33k stars 262 forks source link

[New package]: metals #369

Open yungParrot opened 1 year ago

yungParrot commented 1 year ago

Package name metals

Package homepage https://scalameta.org/metals/

Languages scala

How is this package distributed? As .zip or .tar.gz. files. See releases

cjgratacos commented 1 year ago

This one will be great to have.

benjstephenson commented 1 year ago

I was taking a look at this today (not done much Lua in the past so a bit slow going for me), I was wondering if it makes sense to use the metals package directly or via the nvim-metals package as it does a lot of config already that would probably end up being duplicated?

williamboman commented 1 year ago

Yeah the nvim-metals plugin provides a :MetalsInstall command. I believe it's only available via Coursier, for which support would need to be added from scratch in Mason (similar to npm for example). There might be some aspects of Coursier that makes it a bad fit for Mason - for example inability to customize installations (we don't want to be installing packages outside of Mason's install dir for instance).

For people who want to use metals I'd strongly recommend using the nvim-metals plugin (and managing ones metals installation through it)

ckipp01 commented 1 year ago

Hey! 👋🏼 the author of nvim-metals here and just wanted to jump in here since I had a user asking about this on our Discord.

I believe it's only available via Coursier, for which support would need to be added from scratch in Mason

Correct, we actually don't provide executable binaries by default. The zip files that someone linked about in the releases are just the sources. Most Scala users will hopefully be familiar enough with Coursier to use it to install since it's used to even install Scala itself. nvim-metals actually doesn't use the defualt cs install, but rather a more complex bootstrap command that gives us the ability to do thing like easily tell it where to generate the binary, plus some other goodies.

So yea, I sort of agree that if a user is looking for an easy way to get metals installed, just let nvim-metals do it for you. There is also the option of having it globally installed and having nvim-metals use that.

If mason really wanted to support it, one thing that we could maybe do it have mason piggy back on nvim-metals and just use the Lua api we provide to install Metals. Implementing coursier in mason may be overkill since so few apps will be installed that way. Either way, if there is anything I can do on my end to help the situation, don't hesitate to ping me.

mvillafuertem commented 7 months ago

any news on this? @ckipp01 @williamboman

ckipp01 commented 7 months ago

Hey @mvillafuertem I'm not actively working or involved in this really. My own opinion as the author of nvim-metals is to either let nvim-metals handle the install, or use coursier directly to install Metals and then tell nvim-metals to use that global installation. Seeing this message from @williamboman

For people who want to use metals I'd strongly recommend using the nvim-metals plugin (and managing ones metals installation through it)

My guess is that we're sort of aligned here.