Skip to content

Unnecessary temporary TU is created for the active file when config provider is reconfigured #9003

Closed
@Colengms

Description

@Colengms

When a custom configuration provider is reconfigured, cpptools first clears all custom configurations, which resets all TUs and triggers recreation of the TU for only the active file (without a custom configuration). Then, it provides custom configurations separately for each open file. Assuming there is still (or is now) a custom configuration for the active file, its TU gets recreated again.

The clearing and updating could be consolidated into a single operation, to avoid creating the unnecessary TU. Updating all files at once might require a bit of refactoring of the logic that provides custom configurations, as it currently delivers configs for each file using separate messages.

Alternatively, reconfiguration could instead check if there is an updated configuration for the active file and, if so, update that file first and include a bool indicating that all other TUs should be reset. (Or, if no new config for the active file, use the existing logic.) That should be sufficient as only the active file's TU is automatically recreated when custom configurations are cleared. Custom configurations for all other open files should be delivered before their TUs get recreated.

Metadata

Metadata

Assignees

Labels

Feature: ConfigurationAn issue related to configuring the extension or IntelliSenseFeature: Configuration ProviderRelated to the configurationProvider property, e.g. ms-vscode.cmake-tools, ms-vscode.makefile-tools.Language ServicefixedCheck the Milestone for the release in which the fix is or will be available.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions