New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metals: init at 0.3.2 #51988
metals: init at 0.3.2 #51988
Conversation
[Metals](https://scalameta.org/metals/) is a language server for the Scala programming language.
@GrahamcOfBorg build metals |
|
||
let | ||
baseName = "metals"; | ||
version = "0.3.1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v0.3.2 is out. Once this PR is merged we can update our release process (https://github.com/scalameta/metals/blob/master/RELEASING.md) to make sure this nix installation stays up-to-date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated to 0.3.2 a few days ago. I know that there was a 0.3.3 patch, but I'm not sure whether I should update this PR or if it's easier to get it merged if we freeze it and submit updates in future PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating in separate PR sounds good 👍 I've already updated our release checklist to bump up the version/outputHash here https://github.com/scalameta/metals/blob/master/RELEASING.md
-Xmx4G | ||
-Dmetals.client=vim-lsc | ||
''; | ||
maintainers = with maintainers; [ ceedubs ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add coconnor
as a maintainer as well. (that's myself) I'm happy to handle updates in case ceedubs is unavailable or occupied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Also added coconnor as a maintainer per request.
description = "Language server for Scala"; | ||
longDescription = '' | ||
This executable includes a minimal number of flags by default, and when | ||
using it, you will likely want to pass in additional flags such as: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that if you add additional arguments to the command as it's currently set up, they will be interpreted as arguments to the main
method as opposed to as java flags (which is what the call probably wants). I'm going to close this out until we resolve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coreyoconnor do you have any ideas on a good approach to this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One possible approach is to do something like this: https://github.com/ceedubs/dotfiles/blob/282be59488af7b2a53eb69f6494bda75c870edef/metals/default.nix#L33
But this means that if someone wants to specify different java flags (ex: for emacs defaults), they have to change what they pass into the nix derivation as opposed to just changing a runtime flag that they pass to metals
.
Ultimately I guess that what makes this kind of awkward is the positional nature of arguments passed into java
(first flags then class name then main
arguments).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a big change in Metals to support regular cli argument -Dmetals.client=emacs
. However, users should still be able to customize -Xmx
and -Xms
in my opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olafurpg I agree. I don't see much benefit in changing metals to support the CLI argument. That might just serve to make it more confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One mechanism is similar to @ceedubs referenced: Add a config param to the function that produces the derivation. When called using callPackage
(as is the standard in nixpkgs) This can be overloaded in nixpkgs using the override
function:
How come this was closed? |
@liff I closed it because it wasn't clear to me how to provide a derivation that wasn't specific to a particular setup (ex: vim-lsc vs another client). The derivation that I use lives here. Feel free to use it, improve upon it, turn it into a better PR, etc. Edit: @coreyoconnor's solution described here is probably the right approach, but I have never had a very good understanding of overrides and overlays, which is the main reason why I haven't pursued that further. |
Since the official instructions seem to be to generate separate |
Metals is a language server for the
Scala programming language.
Motivation for this change
Metals is a very useful piece of a Scala development environment, and being able to set up one's development environment through Nix is useful for reproducibility and the ability to perform rollbacks.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)