scalameta / metals-feature-requests

Issue tracker for Metals feature requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Gradle build server

tgodzik opened this issue · comments

Is your feature request related to a problem? Please describe.

It's still early days but I think it's worth to track it. Gradle is starting to support the BSP protocol. It's currently only done in a VS Code plugin, but we might be able to use that at some point.

Sources for it are here https://github.com/microsoft/vscode-gradle/blob/develop/extension/jdtls.ext/com.microsoft.gradle.bs.importer/src/com/microsoft/gradle/bs/importer/GradleBuildServerBuildSupport.java

I managed to work around no existing tooling by creating a json (had some help there):

{
  "name": "gradle",
  "languages": ["java"],
  "argv": [
    "/usr/lib/jvm/openjdk17/bin/java",
    "--add-opens=java.base/java.lang=ALL-UNNAMED",
    "--add-opens=java.base/java.io=ALL-UNNAMED",
    "--add-opens=java.base/java.util=ALL-UNNAMED",
    "-Dplugin.dir=/home/tgodzik/.vscode/extensions/vscjava.vscode-gradle-3.13.3/server/plugins/",
    "-cp",
    "/home/tgodzik/.vscode/extensions/vscjava.vscode-gradle-3.13.3/server/server.jar:/home/tgodzik/.vscode/extensions/vscjava.vscode-gradle-3.13.3/server/runtime/*",
    "com.microsoft.java.bs.core.Launcher"
  ]
}

We would need to download the jars automatically.

Describe the solution you'd like

Some support for Gradle BSP once it's mature enough or if we want we can help out with some stuff that we need.

Describe alternatives you've considered

Use Bloop as we do currently.

Additional context

No response

Search terms

BSP Gradle