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

Is it possible to set bspEnable := false by default? #193

Open
ckipp01 opened this issue Jan 23, 2021 · 1 comment
Open

Is it possible to set bspEnable := false by default? #193

ckipp01 opened this issue Jan 23, 2021 · 1 comment

Comments

@ckipp01
Copy link

ckipp01 commented Jan 23, 2021

There has been a few different issues that have popped up for us over in Metals that boil down to having Jmh set as a build target in BSP terms that cause odd issues that are pretty hard to track down. When .enablePlugins(JmhPlugin) is added to a module, it adds an additional /project/#module/Jmh build target that often errors when buildTarget/sources is sent to sbt when sbt is serving as a BSP server. You can see an example of this here in this issue.

One of the recommendations from the sbt side is:

Ideally the Jmh / bspEnabled := false should be set by the JmhPlugin itself.

This would still cause everything to work as expected with the plugin, but it just wouldn't add the extra Jmh build target for the module when using sbt as a BSP server.

Setting this in the plugin itself is quite easy, but the key only exists in sbt >= 1.4.0. I'm not 100% sure then if it's possibly to set this in the plugin without requiring users to use sbt >= 1.4.0 (which I know isn't ideal), or if there is a fancy way to only set it if using sbt >= 1.4.0.

If there is any other details I can provide for this, please let me know, but it'd be great to have this disabled by default to users that are using it while also using sbt as a BSP server don't get tripped up.

@retronym
Copy link
Member

@ckipp01 You can reference a SBT setting or task key with just a String, as: SettingKey[Boolean]("bspEnabled")

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