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

user settings C_Cpp > Default: Compiler Path behavior from setting empty string vs undefined #10795

Closed
snehara99 opened this issue Apr 10, 2023 · 5 comments
Assignees
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release
Milestone

Comments

@snehara99
Copy link

Hi, so I noticed a possible bug or unexpected behavior regarding the compiler path settings while trying to repro a user issue on vscode-cmake-tools (3096):

If I remove the default compilerPath from my user settings.json completely (set undefined), compilerPathIsExplicit depends only on the compilerPath setting in c_cpp_properties.json. However, if the default compilerPath in user settings is set to an empty string rather than being undefined, compilerPathIsExplicit is always true.

I think this difference in behavior between the default compiler path in user settings being an empty string vs being undefined can be confusing, but I also understand this may be expected behavior. I just wanted to point it out.

However, I think a larger issue is when changing the default user settings via the UI rather than the settings.json file, an empty string versus undefined is indistinguishable. Erasing the default compiler path results in the default compiler path to be set to an empty string in the user settings.json file rather than undefined. I think this could cause unanticipated problems for users using the UI rather than the settings.json file.

I'm not sure if this is a bug, but I think it would help if some warning was given in the UI at least. Let me know if you'd like any clarification, thanks!

@browntarik
Copy link
Contributor

This is by design but displaying a notification in the language status UI may be helpful.

@browntarik browntarik added the enhancement Improvement to an existing feature label Apr 10, 2023
@browntarik
Copy link
Contributor

browntarik commented Apr 10, 2023

Since we need the VS Code UI to distinguish between an undefined or empty string for the optimal fix, we decided to keep this as known issue. This is a regression from an older fix we had for this issue so we may take a look at this as well.

@browntarik browntarik added investigate: repro This issue's repro steps needs to be investigated/confirmed and removed enhancement Improvement to an existing feature labels Apr 10, 2023
@browntarik browntarik added this to the Backlog milestone Apr 10, 2023
@sean-mcmanus sean-mcmanus modified the milestones: Backlog, 1.15.2 Apr 10, 2023
@sean-mcmanus sean-mcmanus added bug fixed Check the Milestone for the release in which the fix is or will be available. regression A bug that didn't exist in a previous release and removed by design investigate: repro This issue's repro steps needs to be investigated/confirmed labels Apr 10, 2023
@Colengms
Copy link
Contributor

#10797 somewhat addresses the issue in VS Code's settings UI, but does not address the same issue in C/C++: Edit Configuration (UI).

@sean-mcmanus
Copy link
Contributor

@Colengms So we should keep this issue open or create another issue for that or what?

@sean-mcmanus
Copy link
Contributor

The settings UI issue is fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.15.2 . I'm not sure if we need another issue to track the Edit Configuration (UI) case or not (feel free to open a new issue if you want).

@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release
Projects
None yet
Development

No branches or pull requests

4 participants