-
Notifications
You must be signed in to change notification settings - Fork 452
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
Add API to Record Compile Invocation #682
base: main
Are you sure you want to change the base?
Conversation
4e56d15
to
109da8d
Compare
Not that I have an actual say, or that Alex wants to have one now, but consider #612 (comment). |
67d9f9e
to
4f67fe1
Compare
I switched to tinyjson to reduce compile times and I also added a feature flag so that user can opt in. |
ba1a308
to
65c867e
Compare
Hi @schrieveslaach! unfortunately I'm using I just have a (probably newbie) question: would this design work if some project needs multiple calls to |
@HKalbasi, thanks for the response.
Does that clarify your question? |
c3c46ce
to
4eba480
Compare
This commit adds API to record the compilation invocations in order to emit compile_commands.json a.k.a. JSON compilation database. Fixes rust-lang#497
4eba480
to
d9dfc09
Compare
@m-ou-se, @Mark-Simulacrum, you seem to be the maintainers of the project. Do you mind to have a look at this PR? |
Yes. I thought It might make sense to have some wrapper type over And thanks for this PR! |
Wouldn't it be more natural to have BTW, is it correct understanding that the file name is actually fixed, compile_commands.json? So that the only variable is the target directory, right? But is it actually? I mean the file is surely searched for in specific locations. For example it's suggested that clangd starts in the directory where the source file is and walks up the tree. This sounds like it would be possible and even appropriate to infer even the destination directory for the database... In other words I wonder if it could be just |
I chose to add I checked the clangd docs and clangd searches for
Running
So, I assume what I could do is that @dot-asm, @m-ou-se, @Mark-Simulacrum, @HKalbasi what do you think about that approach? |
looking forward to using this pr! |
Having an api for recording cmds run is awesome, though IMO the API should be as simple as possible: Just let the users specify a callback |
This commit adds API to record the compilation invocations in order to
emit compile_commands.json a.k.a. JSON compilation database.
Fixes #497
See following screencast that uses Neovim with rust-analyzer and clangd as language servers: