vs-sourcetrail icon indicating copy to clipboard operation
vs-sourcetrail copied to clipboard

" characters need an extra layer of escaping

Open dubois opened this issue 4 years ago • 0 comments

  1. In Visual Studio, add a preprocessor definition PROJECT_NAME="$(ProjectName)".
  2. Note that the symbol PROJECT_NAME expands to a string literal inside your .cpp code.
  3. Extensions -> Sourcetrail -> Create Compilation Database
  4. Note that the .json file contains -D PROJECT_NAME=\"myproject\"
  5. 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.

dubois avatar Apr 28 '20 19:04 dubois