Skip to content

Support relative paths in settings.json/c_cpp_properties.json without using ${workspaceFolder} #2397

Closed

Description

Currently, most settings require using ${workspaceFolder} to use relative paths...we could simplify the experience by using implicit relative paths. +1 this if anyone particularly wants this.

Activity

  1. m417z commented on Dec 21, 2020

    @m417z

    I'm interested in having the ability to use a relative path for compilerPath. Specifically, a path relative to the VSCode installation.
    One use case: A portable package of VSCode and a compiler.

    Say I have a disk-on-key with:

    D:\
        vscode\
            Code.exe
            [...]
        gcc\
            bin\
                g++.exe
                [...]
            [...]
    

    I'd like to be able to use:
    "C_Cpp.default.compilerPath": "..\\gcc\\bin\\g++.exe"
    or:
    "C_Cpp.default.compilerPath": "${execPath}\\..\\gcc\\bin\\g++.exe"

    If there's a way to do that with the current extension, please tell me how to do that, thanks.

  2. changed the title [-]Support relatitve paths in settings.json/c_cpp_properties.json without using ${workspaceFolder}[/-] [+]Support relative paths in settings.json/c_cpp_properties.json without using ${workspaceFolder}[/+] on Dec 22, 2020
  3. bobbrow commented on Jun 26, 2025

    @bobbrow
    Contributor

    This was implemented a while ago, not exactly sure when.

  4. locked and limited conversation to collaborators on Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions