You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 tosuper.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.
The text was updated successfully, but these errors were encountered: