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

Allow to modify the bloop.json configuration file path #287

Open
erayaydin opened this issue Jul 20, 2022 · 5 comments
Open

Allow to modify the bloop.json configuration file path #287

erayaydin opened this issue Jul 20, 2022 · 5 comments

Comments

@erayaydin
Copy link

erayaydin commented Jul 20, 2022

Describe the bug

Metals create ~/.bloop/created_by_metals.lock file without option to describe bloop path. https://github.com/scalameta/metals/blob/8488a02cbab8628b6bf990249bc5483badb705a1/metals/src/main/scala/scala/meta/internal/metals/BloopServers.scala#L534-L542

Reproduce (nvim-metals):

  1. Start nvim
  2. Open a buffer with scala filetype.
  3. It creates ~/.bloop and ~/.bloop/created_by_metals.lock files.

Expected behavior

XDG Base Directory support (XDG_STATE_HOME maybe) or argument for describe bloop lockfile path.

Operating system

Linux

Editor/Extension

Nvim (nvim-metals)

Version of Metals

v0.11.7

Extra context or search terms

  • XDG Base Directory spec
  • ~/.bloop
  • bloop directory
@tgodzik
Copy link
Contributor

tgodzik commented Jul 20, 2022

Thanks for reporting! There was a PR allowing some configuration for Bloop home scalacenter/bloop#1757

However, I decided against it since it's not that easy to make sure that the proper .bloop directory is used. You would need to start Bloop with that env variable and that could be a bit problematic if you wanted to change it from Metlas (you would need to manually stop and start Bloop in the CLI)

There might be some ways to help with your problem, but I am not familiar with XDG Base Directory. What would be needed for Bloop/Metals work correctly with it?

@erayaydin
Copy link
Author

erayaydin commented Jul 20, 2022

What would be needed for Bloop/Metals work correctly with it?

If I understand your question correctly; It is the default behaviour of nvim-metals.

You would need to start Bloop with that env variable and that could be a bit problematic if you wanted to change it from Metals

I'm okay with single running Bloop server. I'm trying to stick with my XDG configuration:

~/.local
├── bin
├── etc
├── include
├── lib
├── share
└── var

Just need to move ~/.bloop to ~/.local/etc/bloop. Are there any way to override sys.props.get("user.home") ? (maybe JAVA_HOME or nvim-metals bloop jvm options)

@tgodzik
Copy link
Contributor

tgodzik commented Jul 21, 2022

To handle this properly we would most likely need a couple of things:

  • add an additional property for launcher or env variable
  • set that in user settings, which can be made workspace specific
  • offer to restart Bloop each time the new user setting changes

I can't currently work on this, so let's move it to feature requests for now.

@tgodzik tgodzik transferred this issue from scalameta/metals Jul 21, 2022
@tgodzik tgodzik changed the title Bloop lockfile hardcoded path Allow to modify the bloop.json configuration file path Jul 21, 2022
@untainsYD
Copy link

untainsYD commented Aug 27, 2023

@tgodzik
Do you have any updates on this ISSUE? It is annoying that bloop/metals ignore XDG specifications in the 2023 year.

@ckipp01
Copy link
Member

ckipp01 commented Sep 1, 2023

Hey @untainsYD there has been no update on this yet on the Bloop side.

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

4 participants