You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Browse configuration is not preserved when config provider is auto-detected #7542
With #6150 , we started automatically using a configuration provider if only one is available, and there is no c_cpp_properties.json. When this occurs, we appear to be failing to persist the 'browse configuration' from the config provider, such that a subsequent reload of the window will fall back to default settings instead of a preserved browse configuration.
We may also be neglecting to request the browse configuration. Code in various places which checks the currently registered config provider would seem to be failing for automatic providers.
The real issue here is that cpptools is not aware of a config provider until it is registered (if not specified explicitly in c_cpp_properties.json). Automatic config provider detection cannot use a config provider by default, until/unless it's registered. If using "cmake.configureOnOpen": true, CMake Tools will register itself early. Otherwise, it does not register itself until a command such as CMake: Configure is run, at which point we receive a new browse configuration anyway.
So, I don't think this is something that can be addressed in cpptools. Perhaps if CMake Tools could always activate if there is a CMakeTools.txt file in the workspace (if it doesn't already), and always register with cpptools at startup, that could address the issue.
Activity
Colengms commentedon May 18, 2021
We may also be neglecting to request the browse configuration. Code in various places which checks the currently registered config provider would seem to be failing for automatic providers.
Colengms commentedon May 20, 2021
The real issue here is that cpptools is not aware of a config provider until it is registered (if not specified explicitly in
c_cpp_properties.json). Automatic config provider detection cannot use a config provider by default, until/unless it's registered. If using"cmake.configureOnOpen": true, CMake Tools will register itself early. Otherwise, it does not register itself until a command such asCMake: Configureis run, at which point we receive a new browse configuration anyway.So, I don't think this is something that can be addressed in cpptools. Perhaps if CMake Tools could always activate if there is a CMakeTools.txt file in the workspace (if it doesn't already), and always register with cpptools at startup, that could address the issue.