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

Validation for VS Code settings #12371

Closed
bobbrow opened this issue Jun 13, 2024 · 0 comments
Closed

Validation for VS Code settings #12371

bobbrow opened this issue Jun 13, 2024 · 0 comments
Assignees
Labels
fixed Check the Milestone for the release in which the fix is or will be available.
Milestone

Comments

@bobbrow
Copy link
Member

bobbrow commented Jun 13, 2024

Feature Request

In package.json we write a lot of metadata to describe what valid values for our settings look like. VS Code will squiggle settings that don't comply with the validation to let the user know, but it will send the invalid values to us until the user corrects the issues (if they ever do).

In src/LanguageServer/settings.ts a lot of our settings are retrieved with a simple call to super.Section.get<T>. This function call does not do any validation and it also does not cast values to the correct type as you might expect. It simply assumes that the value is of the type you request, but it actually may not be!

We are already doing some validation in the language server, but it would be best to do at least the enum and type validation in the TypeScript code. If it makes sense, we could move all validation to TypeScript so that the settings values can always be assumed to be valid everywhere in the codebase.

@bobbrow bobbrow added this to the On Deck milestone Jun 13, 2024
@sean-mcmanus sean-mcmanus modified the milestones: On Deck, 1.21 Jun 14, 2024
@bobbrow bobbrow added this to cpptools Jun 17, 2024
@bobbrow bobbrow moved this to In progress in cpptools Jun 17, 2024
@sean-mcmanus sean-mcmanus moved this from In progress to Pull Request in cpptools Jul 9, 2024
@bobbrow bobbrow modified the milestones: 1.21, On Deck Jul 15, 2024
@sean-mcmanus sean-mcmanus modified the milestones: On Deck, 1.22.0 Aug 2, 2024
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed Check the Milestone for the release in which the fix is or will be available.
Projects
Status: Done
Development

No branches or pull requests

3 participants