Skip to content

compile_commands.json doesn't work with WSL #2510

Description

@kayle

Type: LanguageService

Describe the bug

  • OS and Version: Win10
  • VS Code Version: 1.27
  • C/C++ Extension Version: 0.18.1

To Reproduce

c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "WSL",
            "intelliSenseMode": "gcc-x64",
            "compilerPath": "/usr/bin/gcc",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "compileCommands":"${workspaceFolder}/../BuildOutput/cmake/ninja/compile_commands.json",
            "defines": [],
            "cStandard": "c11",
            "cppStandard": "c++17"
        }
    ],
    "version": 4
}

compile_commands.json:

{
  "directory": "/mnt/c/repo/BuildOutput/cmake/ninja/test",
  "command": "/usr/bin/g++  -D_CROSS_PLATFORM=1 -isystem /mnt/c/repo/vcpkg/installed/x64-linux/include   -Wall   -std=gnu++1z -o CMakeFiles/test-statops.dir/test_c1.cpp.o -c /mnt/c/repo/DspOps/test/test_c1.cpp",
  "file": "/mnt/c/repo/DspOps/test/test_c1.cpp"
}

Expected behavior

I expect the WSL paths from compile_commands.json to get translated to the corresponding Windows paths.

Screenshots

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions