Add feature gate to startEntries until full API review

This commit is contained in:
Jackson Kearl 2021-07-01 08:13:55 -06:00
parent 8e16690b35
commit 112e1451ea
No known key found for this signature in database
GPG key ID: DA09A59C409FC400
2 changed files with 10 additions and 0 deletions

View file

@ -314,6 +314,12 @@ configurationRegistry.registerConfiguration({
type: 'boolean',
default: true,
description: localize('workbench.welcomePage.walkthroughs.openOnInstall', "When enabled, an extension's walkthrough will open upon install the extension. Walkthroughs are the items contributed the the 'Getting Started' section of the welcome page")
},
'workbench.welcome.experimental.startEntries': {
scope: ConfigurationScope.APPLICATION,
type: 'boolean',
default: false,
description: localize('workbench.welcome.experimental.startEntries', "Experimental. When enabled, extensions can use proposed API to contribute items to the New=>File... menu and welcome page item.")
}
}
});

View file

@ -34,6 +34,7 @@ import { isLinux, isMacintosh, isWindows, OperatingSystem as OS } from 'vs/base/
import { localize } from 'vs/nls';
import { IQuickInputService, IQuickPickItem, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import product from 'vs/platform/product/common/product';
export const WorkspacePlatform = new RawContextKey<'mac' | 'linux' | 'windows' | undefined>('workspacePlatform', undefined, localize('workspacePlatform', "The platform of the current workspace, which in remote contexts may be different from the platform of the UI"));
export const HasMultipleNewFileEntries = new RawContextKey<boolean>('hasMultipleNewFileEntries', false);
@ -513,6 +514,9 @@ export class GettingStartedService extends Disposable implements IGettingStarted
}
private async registerExtensionNewContributions(extension: IExtensionDescription) {
if (product.quality === 'stable' && !this.configurationService.getValue('workbench.welcome.experimental.startEntries')) {
console.warn('Warning: ignoring startEntries contributed by', extension.identifier, 'becuase this is a stable build and welcome.experimental.startEntries has not been set');
}
extension.contributes?.startEntries?.forEach(entry => {
this.registerNewMenuItem({
sourceExtensionId: extension.identifier.value,