8000 refactor the compilerPath verification to get consistent results in JSON and UI verification by bobbrow · Pull Request #13553 · microsoft/vscode-cpptools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor the compilerPath verification to get consistent results in JSON and UI verification #13553

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

Merged
merged 20 commits into from
May 1, 2025

Conversation

bobbrow
Copy link
Member
@bobbrow bobbrow commented Apr 25, 2025

For 1.26

@bobbrow
Copy link
Member Author
bobbrow commented Apr 28, 2025

Ready for review now

@bobbrow bobbrow marked this pull request as ready for review April 28, 2025 22:57
@bobbrow bobbrow requested a review from a team as a code owner April 28, 2025 22:57
@bobbrow bobbrow added this to the 1.26 milestone Apr 28, 2025
Copy link
Contributor
@sean-mcmanus sean-mcmanus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we want to prevent users from accidentally creating "compilerPath: "" in c_cpp_properties.json? I'm seeing compilerPath default to "" when users type it in the json editor. I thought we had create some workaround to make it default to something else like null. Or maybe I'm thinking about another property? I thought we had done something similar for browse.path to prevent users from accidentally creating an empty browse.path by default.

It the type were string or null, then we could default the schema to populate it with null to prevent "" from being used by default.

Oh, it looks like null is used at the defaults for the C_Cpp.default.* equivalent settings.

Copy link
Contributor
@sean-mcmanus sean-mcmanus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something seems wrong in this case:

image

It says there are spaces and arguments, but there are not.

Copy link
Contributor
@sean-mcmanus sean-mcmanus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The squiggle isn't covering the entire path:

image

@bobbrow
Copy link
Member Author
bobbrow commented Apr 30, 2025

Something seems wrong in this case:

image

It says there are spaces and arguments, but there are not.

If the path does not exist, and there are no quotes around the compiler, we split the string by spaces, take the first token as the compiler and the remaining tokens as the args. I can see how this error message is confusing though. I think I can make it longer and say that it's one of two problems instead.

@bobbrow
Copy link
Member Author
bobbrow commented Apr 30, 2025

The squiggle isn't covering the entire path:

image

I believe that this is the current behavior in the extension (i.e. not a regression caused by my changes)

@bobbrow
Copy link
Member Author
bobbrow commented Apr 30, 2025

Didn't we want to prevent users from accidentally creating "compilerPath: "" in c_cpp_properties.json? I'm seeing compilerPath default to "" when users type it in the json editor. I thought we had create some workaround to make it default to something else like null. Or maybe I'm thinking about another property? I thought we had done something similar for browse.path to prevent users from accidentally creating an empty browse.path by default.

It the type were string or null, then we could default the schema to populate it with null to prevent "" from being used by default.

Oh, it looks like null is used at the defaults for the C_Cpp.default.* equivalent settings.

Ok, you may be right about this for c_cpp_properties.json. I didn't recall why we added null for the schema. I can revert some of this. I would agree that it is preferrable to insert null over "" for this property.

@bobbrow
Copy link
Member Author
bobbrow commented Apr 30, 2025

@sean-mcmanus I tested the compilerPath property in c_cpp_properties.json some more, and it looks like when you autocomplete compilerPath VS Code inserts the empty string right now (1.25.3). It looks like "null" has to be the first option in the list for it to autocomplete to null as we want. I'll fix that. CTL+Space to invoke completion after the colon does only offer null in either case.

@bobbrow bobbrow enabled auto-merge (squash) April 30, 2025 18:57
@sean-mcmanus sean-mcmanus self-requested a review April 30, 2025 21:47
@bobbrow bobbrow merged commit 56576c8 into main May 1, 2025
6 checks passed
@bobbrow bobbrow deleted the bobbrow/compilerPathVerification branch May 1, 2025 00:16
@github-project-automation github-project-automation bot moved this from Pull Request to Done in cpptools May 1, 2025
@sean-mcmanus sean-mcmanus modified the milestones: 1.26, 1.26.0 May 20, 2025
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.

2 participants
0