dprogm/vscode-bazel-tools

Integrate features into bazelbuild/vscode-bazel

laurentlb opened this issue ยท 9 comments

https://github.com/bazelbuild/vscode-bazel has evolved. We plan to make it the official VS Code plugin for Bazel. It's probably better for users to have everything in one plugin.

Are there features from vscode-bazel-tools you'd like to add to vscode-bazel?

Thanks!

(we can give write access if you want to help maintain that repository)
(cc @allevato)

zaucy commented

In my opinion the most useful feature of this repository is the generation of the c_cpp_properties.json file. It allows my c++ bazel target (albeit only 1 at a time) to have autocomplete features in vscode.

Hi @laurentlb,

Like @zaucy mention the main purpose of the repository was to generate C++ project.

For my part I also work on some others features:

  • Task provisioning
  • Multi C++ project management
  • Java project generation

The two first one are available in my fork and I was thinking to summit a pull request to @dprogm (I was finishing to test some parts).
And the last one, java project generation, is available in the feature/javaproject branch, it work but there is some part I would like to improve...

Sorry for the late response. I am very interested in moving the main parts (actually generating C++ project files as @zaucy already mentioned) to vscode-bazel. My vision always was to extend the plugin in order to maintain polyglot applications in one place (C++, Java, Python) which never happened because of other time consuming activaties.

@quentingodeau I would appreciate if we could merge it up to a common baseline and migrate it to vscode-bazel. Currently I am not really familiar with the architectural approach and what the main goals of vscode-bazel are. The current solution for language support in vscode via bazel is to rely on other third party plugins and their proprietary project files. Maybe we could come up with a uniform solution for IDE features like code completion.

@laurentlb Is there a way to communicate ideas and plans before trying to contribute a complete solution that doesn't fit well into the plugins framework of vscode-bazel?

The current solution for language support in vscode via bazel is to rely on other third party plugins and their proprietary project files. Maybe we could come up with a uniform solution for IDE features like code completion.

It would depend on what you mean by supporting those features. Language-specific features belong in the extensions and language servers for those languages, because we don't want to try to replicate very complex capabilities of multiple languages in our Bazel extension.

Instead, it would be worth investigating ways that the Bazel extension help the other language-specific extensions. For example, maybe we could use an aspect to generate a compile_commands.json file that could be fed into clangd. But other languages will need different approaches that integrate with their language servers.

Is there a way to communicate ideas and plans before trying to contribute a complete solution that doesn't fit well into the plugins framework of vscode-bazel?

My recommendation would be to file issues for the features you'd like to see/contribute and we can use that to discuss high-level approaches before diving into the implementation.

Instead, it would be worth investigating ways that the Bazel extension help the other language-specific extensions. For example, maybe we could use an aspect to generate a compile_commands.json file

Exactly this is the approach I have started with by generating c_cpp_properties.json in the target workspace that it can be used by vscode-cpptools. The aspect needs refinements and a bit generalization in order to easily extend it for generating compile_commands.json too.

I think @quentingodeau has used a similar approach by generating the classpath for java projects. In his fork there is already a structure and direction visible of how we could implement language support generally. I am currently investigate what needs to be done in order to enable things like auto completion for python targets (pip dependencies).

I'd like to wait for @quentingodeau thoughts because he has already contributed a lot of useful stuff and pushed the development of the extension. Then we create issues and discuss further actions in the corresponding thread.

Hi everyone and Happy new year ! I'm sorry for the late I finally create the PR (#11 #12). Yes I follow the idea to go throw aspect in order to generate the right project file for java project like @dprogm does for cpp one. In fact I do not really generate the project file directly from aspect. I only extract all the information I required to create it and then TS part use the generated file to really create the project file.
Note: For the java part I use the Language Support for Java(TM) by Red Hat
I'm interested to work with you to add (and improve, review, ... with you) these feature in your project.

VSCode+Java+Bazel support is described in this issue about the Redhat-made Java tooling for VSCode:

redhat-developer/vscode-java#909

(No idea if there is anyone involved in that project with an inclination to do it.)

Whats the status for this and is there anything a newbie can do to help? VSCode is so bad right now when using bazel - none of the intellisense works and it consumes all of my ram trying to search through the bazel-out and bazel-project folders

Please use https://github.com/bazelbuild/vscode-bazel (and report issues there).