CoatiSoftware / vs-sourcetrail

Visual Studio Extension to communicate with Sourcetrail and generate a JSON Compilation Database from a Visual Studio Solution
Apache License 2.0
117 stars 42 forks source link

Detect and report if the VS solution (project) isn't built #64

Open PhilipOakley opened 4 years ago

PhilipOakley commented 4 years ago

In my first attempts at using Sourcetrail, I was creating the compilation database for the .sln version of git-for-windows direct from it's checkout. This succeeded, but I still had errors and unscanned entries when loading into Sourcetrail.

One of the recovery steps was to actually build the solution (sort of obvious, but not necessary for navigating the solution in VS..).

If possible, warn the user if the current solution isn't built. :smiley:

I'm expecting that the VS build actually generates extra information that is included in the compile_commands.json file, so it's worth warning folks who have forgotten or didn't realise...

mlangkabel commented 4 years ago

Do you still have the old compile_commands.json that you generated before building lying around? If yes, are there any differences to the one that you generated after building?

PhilipOakley commented 4 years ago

Do you still have the old compile_commands.json that you generated before building lying around? If yes, are there any differences to the one that you generated after building?

Unfortunately not. It got overwritten. It maybe that it was other factors that needed sorting that actually cured the problems. I guess you are expectating that if this was a cleanly loaded .sln file then the compilation (as far as the .json out put is concerned) is a no-op/no-change. Thus expecting that it's only if users edit the solution's properties that it would change...

However what I did notice in the VS solution and in the updated/rewritten compile_commands.json is the presence of the -D defines directives that needed to be manually processed and added to the Source group.

It does feel a little counter productive that these are not at least extracted in the 'one per line format' ready for the user to copy/paste (and edit) into the compiler directives dialog. It is a real big hassle to try and extract those directives (from the .json or .sln files, or preprocessor properties - all on one line!) and get them into shape (one per line) for pasting into the source group dialog.

I'll see if I can do a clean attempt, but its a bit fire fighting at the moment.