Skip to content
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

Missing ability to configure metals JVM options #108

Open
jypma opened this issue May 23, 2024 · 2 comments
Open

Missing ability to configure metals JVM options #108

jypma opened this issue May 23, 2024 · 2 comments

Comments

@jypma
Copy link

jypma commented May 23, 2024

Metals (at least on arch linux) defaults to a heap size of -XX:MaxRAMPercentage=25.0, which can be quite significant. This can be customized by setting the METALS_JAVA_OPTS environment variable when launching metals.

lsp-metals could provide a defcustom where such JVM options can be configured.

As for implementation, that might not be obvious, since lsp-stdio-connection expects a single command with arguments. env or bash could be used here, but that would be linux-specific. Not sure how to do that platform-independently.

@kurnevsky
Copy link
Member

You can do it in a bit hacky way replacing metals command with env, see https://github.com/kurnevsky/nixfiles/blob/b153ac54f0a3491e4802d13627f1a8e36564a36a/modules/emacs/init.el#L1509 for the example.

@jypma
Copy link
Author

jypma commented May 23, 2024

Ah, creative, thanks for the tip. I ended up writing a small script wrapping metals myself.

Should we keep the topic open? It's still something that could be more user-friendly, especially since the requirement to add environment variables to an lsp server might be needing a small patch in lsp-mode itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants