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
Clarify "defaultValue" in Workspace Configuration section #105598
Comments
The documentation for vscode-api is auto-generated from https://github.com/microsoft/vscode/blob/master/src/vs/vscode.d.ts, so the updates would need to be made in the vscode repo. |
Oops, I will transfer it back then 😄 |
Not sure which default value you mean, if it is about following: /**
* Return a value from this configuration.
*
* @param section Configuration name, supports _dotted_ names.
* @param defaultValue A value should be returned when no value could be found, is `undefined`.
* @return The value `section` denotes or the default.
*/
get<T>(section: string, defaultValue: T): T; As the documentation says above API returns the value for the given section, if there is no value found (ie., undefined) then passed in Let me know if there can be improvements, happy to do it. |
@sandy081 The The |
I see what you mean, the |
I think that would be appropriate. I might suggest "(from package.json)" over "(if defined)", which I'd be afraid may still lead someone to believe the defaultValue can be defined with the |
#105550
In https://code.visualstudio.com/api/references/vscode-api#WorkspaceConfiguration, we repeatedly use
defaultValue
in examples, referring to the default value the setting was created with. This behaves differently than thedefaultValue
parameter used when callingWorkspaceConfiguration.get
. If I understand correctly, the former gets merged with other values in the settings hierarchy, and the latter is only used if the setting is undefined.The text was updated successfully, but these errors were encountered: