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

Bazel Support #909

Open
doug-ol opened this issue Apr 30, 2019 · 14 comments
Open

Bazel Support #909

doug-ol opened this issue Apr 30, 2019 · 14 comments

Comments

@doug-ol
Copy link

doug-ol commented Apr 30, 2019

vscode-java does not recognize bazel as a build environment

Environment
  • Operating System:
  • JDK version:
  • Visual Studio Code version:
  • Java extension version:
Steps To Reproduce
  1. Load a java project with bazel as the build system (example)
  2. Navigate to any .java file
Current Result

Receive "Classpath is incomplete" warning

Expected Result

vscode-java to infer classpath from bazel

Additional Informations
@enriched
Copy link

Seems like this work would be related to eclipse-jdtls/eclipse.jdt.ls#543

@perezd
Copy link

perezd commented May 25, 2019

I would also love to see this supported.

@neakor
Copy link

neakor commented Jun 28, 2019

I would love to get this support as well please!

@raulAtNines
Copy link

After tinkering for hours, I have not yet been able to get vscode to launch & debug my java+bazel project. I can run in console no problem, but I also love this request to get bazel fully supported in vscode-java.

@virtuahost
Copy link

Its very painful to work in a monorepo with vscode without this.

@enriched
Copy link

A thought on how to implement this. We could reuse the JDT extension bundle from salesforce/bazel-eclipse. Not sure on the best route for repackaging this for VSCode and making sure that the project is credited though.

@Jonpez2
Copy link

Jonpez2 commented May 18, 2020

Interesting. I spent Friday noodling with the intellij plugin, slicing out the intellij-ide-info.txt generation piece into something I could reuse. I ended up with something super hacky, which for example lifts the test code into the generator to allow injection of bits of the parsing code using intellij's dependency injection framework. From there I then generated a json snippet that can be copied-n-pasted into settings.json. Hack-city!

I could share that if people thought it useful, but it lacks a certain panache, shall we say.

I filed an issue with the bazel-IntelliJ people to see if they were enthused, but they weren't particularly, which is fair enough:

bazelbuild/intellij#1827

@enriched
Copy link

Love it, I see your hacky plugin and raise you this hacky bash script that I'm using as a workaround

https://gist.github.com/enriched/b0a685e124a2abff3ac92bf3a5e63630

@Jonpez2
Copy link

Jonpez2 commented May 21, 2020

Oh, you made a project and classpath. Maybe that's a better idea. OK when I get time I'm going to put my hacktasticness up on github and maybe try to dehack a little bit, and try to see if our bazel-intellij friends like the idea.

@Jonpez2
Copy link

Jonpez2 commented May 26, 2020 via email

@chong1144
Copy link

Some update may link with #1825. Any plan to make javaBuildFilePatterns including BUILD and WORKSPACE default?

@jalilalchy
Copy link

Beyond adding regex patterns to javaBuildFilePatterns, would any additional work be needed?

@jalilalchy
Copy link

Please advise.

@guw
Copy link

guw commented Jul 10, 2023

We have a Bazel VSCode Java Extension at https://github.com/salesforce/bazel-vscode-java. It adds Java support for Bazel projects to VS Code based on RedHat's Java extension.

The Bazel Language Server (and the Bazel Eclipse Feature) received a significant overhaul. This update needs to be brought into the VS Code extension. Any contributions are highly appreciated. The language server can be fetched from https://opensource.salesforce.com/bazel-eclipse/latest/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests