Open thokra1 opened 4 months ago
@gcampbell-msft We can reproduce the issue as detailed below. But we are not sure if this is by design, could you help us to see it? Thanks!
ENV:
Repro steps:
Actual result: Only shows the "CMakeLists.txt" and "main.cpp" and "CMakePresets.json" file on "Project Outline" page
@Yingzi1234 The GIF doesn't show a custom target, but a regular executable. The latter work fine. This report is about custom targets, i.e. targets added with add_custom_target(..... SOURCES ...)
that don't work.
Just noticed that it works fins for custom targets that don't specify any COMMAND
s. I have not tested any further.
Consider this snippet:
add_custom_target(schmerp COMMAND npm install WORKING_DIRECTORY . SOURCES gerp.js )
In VS 22 we then have
but in VS Code we have
Removing the COMMAND
yields the following in VS Code
@gcampbell-msft We can reproduce the issue as detailed below. Please let me know if you have any concern! Thank you!
ENV:
Repro steps:
add_custom_target(schmerp COMMAND npm install WORKING_DIRECTORY . SOURCES gerp.js )
COMMAND npm install
Actual result: Remove the code and the gerp.js file will appear in the list
@thokra1 This is an interesting use case, however, we do attempt to mirror functionality from VS here, so I will mark it as an enhancement request for the Project Outline view! Thanks.
If DEPENDS
is added to the custom target, vscode also doesn't show the SOURCES
files.
Brief Issue Summary
Expected behavior
Show files listed in the
SOURCES
list of a custom target.Visual Studio 2022 shows the whole list of sources including the proper hierarchy, if any.
Actual behavior
Source files and folder structure, if any, are not shown.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
VS Code version: 1.91.0 Version of the extension: v1.18.42