Skip to content

Custom config updates result in unnecessary TU updates against the base config #12632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Colengms opened this issue Aug 26, 2024 · 0 comments
Closed
Assignees
Labels
Feature: Configuration Provider Related to the configurationProvider property, e.g. ms-vscode.cmake-tools, ms-vscode.makefile-tools. fixed Check the Milestone for the release in which the fix is or will be available. Language Service performance
Milestone

Comments

@Colengms
Copy link
Contributor

I've noticed that whenever I reconfigure with CMake Tools, I get 2 TU updates (per visible file). First, in reaction to clearing custom configurations, it starts a TU update using the base config (which can be very slow if that's not a proper config for the file). Then, once custom configs have been generated (async, and a little time consuming due to needing to QueryTranslationUnitSource for each open file), another TU update starts, using the new custom config. Because operations that need a TU will block until TU creation is complete, and the new config does not arrive immediately, the new config does not interrupt the first TU creation. I always have to wait for both to complete.

This issue is tracking reducing this to a single TU update, using the new custom config.

Currently, custom configurations are requested prior to processing didOpen for a file. Then, when a provider calls didChangeCustomConfiguration we clear custom configs, then request and deliver new configs for each tracked file.

Since that was originally implemented, we've added code to request custom configurations on-the-fly (as needed, by FAR/Rename, etc.).

I'd like to rework how custom configurations are delivered. All TU creation attempts could simply leverage the on-the-fly requests. Redundant requests for configuration that cannot be supplied can be avoided by caching 'not available' results for failed config requests.
Instead of delaying didOpen, we could send that immediately. When we receive didChangeCustomConfiguration from a provider, that could simply deliver a single update to the native side to trigger discarding of cached custom configurations and 'not available' tracking, and trigger TU recreation.

@Colengms Colengms added Language Service performance Feature: Configuration Provider Related to the configurationProvider property, e.g. ms-vscode.cmake-tools, ms-vscode.makefile-tools. labels Aug 26, 2024
@Colengms Colengms self-assigned this Aug 26, 2024
@bobbrow bobbrow moved this to In progress in cpptools Aug 27, 2024
@bobbrow bobbrow added this to the On Deck milestone Aug 27, 2024
@Colengms Colengms moved this from In progress to Done in cpptools Sep 18, 2024
@Colengms Colengms added the fixed Check the Milestone for the release in which the fix is or will be available. label Sep 18, 2024
@sean-mcmanus sean-mcmanus modified the milestones: On Deck, 1.22.4 Sep 20, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature: Configuration Provider Related to the configurationProvider property, e.g. ms-vscode.cmake-tools, ms-vscode.makefile-tools. fixed Check the Milestone for the release in which the fix is or will be available. Language Service performance
Projects
Status: Done
Development

No branches or pull requests

7 participants
@bobbrow @sean-mcmanus @Colengms and others