mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Do not throw on top-level property access (fixes #31854)
This commit is contained in:
@@ -512,7 +512,7 @@ export function createApiFactory(
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
const api: typeof vscode = {
|
||||
version: pkg.version,
|
||||
// namespaces
|
||||
commands,
|
||||
@@ -523,11 +523,7 @@ export function createApiFactory(
|
||||
workspace,
|
||||
scm,
|
||||
debug,
|
||||
get credentials() {
|
||||
return proposedApiFunction(extension, () => {
|
||||
return credentials;
|
||||
})();
|
||||
},
|
||||
credentials,
|
||||
// types
|
||||
CancellationTokenSource: CancellationTokenSource,
|
||||
CodeLens: extHostTypes.CodeLens,
|
||||
@@ -581,6 +577,10 @@ export function createApiFactory(
|
||||
Task: extHostTypes.Task,
|
||||
ConfigurationTarget: extHostTypes.ConfigurationTarget
|
||||
};
|
||||
if (!extension.enableProposedApi) {
|
||||
delete api.credentials; // Instead of error to avoid #31854
|
||||
}
|
||||
return api;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user