Skip to content

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

Open
@Colengms

Description

@Colengms

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:

microsoft/vscode-cpptools-api#42
microsoft/vscode-cpptools#9266

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: cpptools integrationenhancementan enhancement to the product that is either not present or an improvement to an existing feature

    Type

    No type

    Projects

    Status

    Pending Prioritization

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions