-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Supporting Source Code Autocomplete #179
Comments
Hi @cpsauer, I found some time ago, and still use it, this tools that allow you to generate the Otherwise if you look for something that will generate the 'perfect' |
You're the man, @quentingodeau. Will give it a whirl soon--those are amazing resources, and I'm sure they'll also help out a bunch of future people to come through here. |
@quentingodeau works great, thanks! |
Any news on this? |
Update over here: We ended up building our own, based on the leads @quentingodeau brought up. Lmk if you need something more, too. The result is pretty awesome (we think): Just run a shell script, and it generates a compile_commands.json that interfaces great with clangd. That means we've got autocomplete for Android NDK, iOS, and macOS files across C, C++, Objective-C, and Objective C++, all together in VSCode. There are a few rough edges, but we're quite happy. [While all the ones listed were good starting points, we found all had serious issues that prevented them from working for our use case. In particular, in order to get the cross-platform thing to work, you really need to listen to the actual compile commands Bazel is emitting with aquery (or action_listener (like Kythe or the gist does), but aquery is orders of magnitude faster and doesn't require a build), not run queries or aspects, which tend to miss configuration from bazel transitions. In retrospect, it makes sense that to extract compilation_commands.json you should listen to bazel's compilation actions directly.... Also, you have to do some careful work to undo bazel's driver wrapping that otherwise prevents clang tooling from understanding the commands and causes issues when the execroot is reconfigured. (Solves issues like these: 1, 2)]. Are other folks also finding that the existing tools don't meet their needs? If enough other folks need it and would be willing to help, I could work on open sourcing it. Update to the update :) |
@cpsauer that would be excellent, i'm surprised people haven't piled in here on this one. |
@cpsauer I'd also be interested in what you managed to pull together, especially if it works in a project with multiple WORKSPACEs, keeping autocomplete suggestions isolated to the relevant sub-project. |
@cpsauer I would also be interested in this script, I've been trying to use the bazel-compliation-database to limited success. I really wish this was a feature supported by default (it seems weird to me that the official bazel plugin wouldn't support something this essential). |
@cpsauer Adding to the support for you to share this. Thanks! |
To add to this discussion a bit I created an example repository how we've achieved autocomplete for our project. We use https://github.com/grailbio/bazel-compilation-database as mentioned #179 (comment), but we substitute the execution root inside the |
@cpsauer Would love to see what you came up with. I have something along these lines: https://gist.github.com/micahcc/bb31e4c91696537f5c0d8b9c8f964255 |
Dear @bhack, @mevensson, @paulherman, @tbienias, @sharif1093, @SnosMe, @372046933, @ConeyLiu, @ycdzj, @robbie-vanderzee, @enihcam, @Nick-Mazuk, @slsyy, @chrisdunelm, @matzipan, @nickshch, @ha11owed, @danzyxr, @wannesvanloock, @silvergasp, @chriscraws, @micahcc, @chong1144, @dhmemi, @sunqi1993, @soulmachine, @raakasf and all others interested in a release, I'm really sorry it took so long, but I finally got this out! I'd love it if you would give it a try and let me know what you think. We love using it every day, so I know the core of it works well. But if it isn't working for you, first users, or I messed up something during release, let's figure out how to make it great for you. Hopefully, I can ask for your patience and help. Basically, would love it if you'd try using. Hope it's great for you! And I hope we can make it even better together. Bazel team members, if you're reading this, lmk--happy to help integrate. |
Thanks @cpsauer , noob Bazel-ler here, when I run Tried adding a
|
Sounds like it (for some reason) doesn't think there are any C language family compile actions in your workspace! We should probably try to troubleshoot over in the compile commands repo proper to avoid swamping this issue with so many folks tagged/following--but we'll need a little more info. Any chance you can share the repo? How about running Once you've got a next lead, go ahead and file an issue in the other repo, and I'll follow up :) |
Update: For C++, C, Objective-C and Objective-C++, please give https://github.com/hedronvision/bazel-compile-commands-extractor a try! We moved to Bazel and built a pretty solid solution for our (and others') problem. Please let me know what you think!
And if you'd like support for other languages, we'd love your help over there, too. Please let us know in an issue what you're thinking about.
Hey all,
We're evaluating a switch from Buck to Bazel. Are there any plans to support autocomplete for source files (esp. C++) in VSCode?
Some leads:
(CC'ing some other folks who participated in that discussion: @laurentlb @zaucy @quentingodeau @dprogm @allevato)
Thanks so much,
Chris
The text was updated successfully, but these errors were encountered: