Skip to content

1.23.5 regression: Include error when using an includePath with a symlink #13214

@Wulgryn

Description

@Wulgryn

Environment

  • OS and Version: Windows_NT x64 10.0.22621
  • VS Code Version: 1.96.4 (user setup)
  • C/C++ Extension Version: 1.23.5
Version: 1.96.4 (user setup)
Commit: cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
Date: 2025-01-16T00:16:19.038Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22621

Bug Summary and Steps to Reproduce

Bug Summary:
After latest update, 1.23.5 the symlink folders not working with includes.

Steps to reproduce:

  1. Create a Symlink Folder to a header folder
  2. Add the symlink to the c_cpp_properties.json
  3. Try to include the file from the symlink path: #include "test.hpp"
  4. Error: cannot open source file...

Expected behavior:
To not show error, and find the content fo the file.

Configuration and Logs

Output -> C/C++

Quick info operation failed: Error: Failed to find translation unit. Try opening a source file that includes this header, then re-open this header.

Other Extensions

No response

Additional context

I have an example file system like this:

test_folder
folder1
--file1.hpp
--folder2
----file2.hpp

Create link as:

mklink /D "test_folder/headers" "folder1"

c_cpp_properties.json

...
"includePath": [
        "${workspaceFolder}/src/",
        "${workspaceFolder}/test_folder"
      ],
...

And with this i was able to replicate the error.

#include "headers/file1.hpp"
#include "headers/folder2/file2.hpp"

Here the suggestion finds the 'headers' but does not find 'file1.hpp' and 'folder2' nor 'file2.hpp'.
Also in this example it's not using/finding the contents of the 'file1.hpp' nor the 'file2.hpp'.

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions