Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.
This repository was archived by the owner on Dec 14, 2021. It is now read-only.

" characters need an extra layer of escaping #67

@dubois

Description

@dubois
  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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions