Skip to content

Question: Can I define path variables in config file, like ${workspaceRoot}? #957

@xueyunquan

Description

@xueyunquan

Hi,

I have a large project that references lots of headers outside the project path, say the headers are under the path /foo/bla/bla/bla/bla/bar . I need to add several include paths into the project config file c_cpp_properties.json , like:

/foo/bla/bla/bla/bla/bar/aaa
/foo/bla/bla/bla/bla/bar/bbb
/foo/bla/bla/bla/bla/bar/ccc
/foo/bla/bla/bla/bla/bar/ccc/ddd

(The 4th line is needed because the new parsing engine does not support recursive including. It would be nice of it is supported.)

Instead of inserting these paths into the config file, I feel like to define the root base of the paths "/foo/bla/bla/bla/bla/bar" as a variable, just like the predefined ${workspaceRoot}, such as ${myHeadersRoot}, and so I can write:

${myHeadersRoot}/aaa
${myHeadersRoot}/bbb
${myHeadersRoot}/ccc
${myHeadersRoot}/ccc/ddd

Can I do that in the config file?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions