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

Auto spawn/connect to bazel-bsp if it's installed #5139

Merged
merged 2 commits into from
Apr 14, 2023

Conversation

tanishiking
Copy link
Member

While we can generate .bsp/bazelbsp.json by
cs launch org.jetbrains.bsp;bazel-bsp:2.6.1 -M org.jetbrains.bsp.bazel.instal.Install https://github.com/JetBrains/bazel-bsp#easy-way-coursier

Metals couldn't connect to the bazel-bsp because it wan't autoConnectable. This change enable Metals to see bazel-bsp as autoConnectable, and Metals will spawn and connct to bazel bsp if there's .bsp/bazelbsp.json.

As @kpodsiad did in
#3233
we should

  • reindex if the build configuration changed
    • I'm wondering we should check all *.bzl files and WORKSPACE and BUILD / BUILD.bazel files. And maybe we should honor the project view settings.
  • Auto install bazel-bsp when we see WORKSPACE file.

#5138
partially fix for #5064

While we can generate `.bsp/bazelbsp.json` by
`cs launch org.jetbrains.bsp;bazel-bsp:2.6.1 -M org.jetbrains.bsp.bazel.instal.Install`
https://github.com/JetBrains/bazel-bsp#easy-way-coursier

Metals couldn't connect to the bazel-bsp because it wan't autoConnectable.
This change enable Metals to see bazel-bsp as autoConnectable, and
Metals will spawn and connct to bazel bsp if there's `.bsp/bazelbsp.json`.

As @kpodsiad did in
scalameta#3233
we should

- reindex if the build configuration changed
  - I'm wondering we should check all *.bzl files and WORKSPACE and
    BUILD / BUILD.bazel files. And maybe we should honor the project
    view settings.
- Auto install bazel-bsp when we see `WORKSPACE` file.

scalameta#5138
partially fix for scalameta#5064
@tanishiking tanishiking added BSP Generic BSP related tickets bazel labels Apr 13, 2023
@tanishiking tanishiking merged commit 56c00d2 into scalameta:main Apr 14, 2023
@tanishiking tanishiking deleted the auto-connect-bazel branch June 16, 2023 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel BSP Generic BSP related tickets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants