scalameta / metals-feature-requests

Issue tracker for Metals feature requests
37 stars 4 forks source link

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

Open erayaydin opened 2 years ago

erayaydin commented 2 years ago

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

tgodzik commented 2 years ago

Thanks for reporting! There was a PR allowing some configuration for Bloop home https://github.com/scalacenter/bloop/pull/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 commented 2 years ago

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 commented 2 years ago

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

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

untainsYD commented 1 year ago

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

ckipp01 commented 1 year ago

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