Skip to content
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

Values set in settings are not immediately available for use after changing them #12881

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

bobbrow
Copy link
Member

@bobbrow bobbrow commented Oct 24, 2024

Fixes: #12705

We can't use the value of a setting we changed on our side until after an await is processed, or we've finished handling the current event.

@bobbrow bobbrow requested a review from a team October 24, 2024 00:40
@bobbrow bobbrow changed the title Values set in settings are not immediately available for use Values set in settings are not immediately available for use after changing them Oct 24, 2024
@thernstig
Copy link

thernstig commented Oct 24, 2024

@bobbrow although this most likely fixes the problem, does it also handle this?

image

The first time the IntelliSense configuration is changed in a new VS Code window, it will update the workspace settings.json as seen. This is highly unexpected I think?

The C/C++: Select IntelliSense Configuration... command seems to be for c_cpp_properties.json.

Updating the "C_Cpp.default.compilerPath" in settings.json makes more sense to do via the settings.json file manually or via the settings GUI. As there you can also define if it should be workspace settings, multi-root workspace settings.json or otherwise.

@bobbrow bobbrow merged commit 5416e79 into main Oct 24, 2024
6 checks passed
@bobbrow bobbrow deleted the bobbrow/staleSetting branch October 24, 2024 20:42
@bobbrow
Copy link
Member Author

bobbrow commented Oct 24, 2024

@thernstig it is currently intentional that we set the setting in settings.json. I no longer remember the discussion around why we chose this way (I want to say that the intent was to make it the default compiler but allow for overriding in a configuration in c_cpp_properties.json). We also set it in c_cpp_properties.json if there is a different value set for it because in this case setting the folder setting would have had no effect. An alternate approach might be to set it in c_cpp_properties.json if that file exists, and in settings.json if it doesn't.

@thernstig
Copy link

@bobbrow I'll ponder if I ever want to setup a separate issue for that one. I'll let it be for now :)

@sean-mcmanus
Copy link
Collaborator

@thernstig If you do create an issue, if you could explain why the current design behavior is insufficient that could help.

@thernstig
Copy link

@sean-mcmanus Will do! I think it is quite easy to reason around, if I opt to do this. But it is not a huge issue so not too tempted to write one since there are more important things you have at hand I am sure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bug: Command C/C++: Select IntelliSense Configuration... -> Use g**
3 participants