vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

Provide (default) configurations for sources not listed in CMakeLists.txt, based on file type

Open Colengms opened this issue 3 years ago • 0 comments

Brief Issue Summary

Currently, if the C/C++ extension doesn't receive a custom configuration from CMake Tools for a file, it will opportunistically fall back to using the compilerPath and compilerArgs provided with the custom browse configuration (a WorkspaceBrowseConfiguration). Unfortunately, the WorkspaceBrowseConfiguration might apply only to C++ files and not C files, or vice versa, as it contains only a single compilerPath and compilerArgs.

Perhaps CMake Tools could provide appropriate default configurations for files not included in any CMakeLists.txt? If CMake Tools has sufficient information to provide the default compilerPath and compilerArgs (as it's already is for the WorkspaceBrowseConfiguration), but based on a type of file, it could provide that as a configuration for that type of file.

That might let us to remove the current fallback logic, which is currently hindered by the existence of only a single compilerPath and compilerArgs. More information on that can be found here:

https://github.com/microsoft/vscode-cpptools-api/issues/42 https://github.com/microsoft/vscode-cpptools/issues/9266

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

Colengms avatar May 04 '22 00:05 Colengms