vs-sourcetrail
vs-sourcetrail copied to clipboard
" characters need an extra layer of escaping
- In Visual Studio, add a preprocessor definition PROJECT_NAME="$(ProjectName)".
- Note that the symbol PROJECT_NAME expands to a string literal inside your .cpp code.
- Extensions -> Sourcetrail -> Create Compilation Database
- Note that the .json file contains
-D PROJECT_NAME=\"myproject\"
- Create a project using the .json file and index it. Note that PROJECT_NAME is not a string literal when the project is indexed.
The existing \
causes the quotes to be preserved in the json, but the quotes don't make their way to clang; probably this is because bash or some other shell is interpreting them.
If I hand-modify the json to contain -D PROJECT_NAME=\\\\"myproject\\\\"
then all works as expected.