Compute 'enableProposedApi' property on main

This commit is contained in:
Sandeep Somavarapu
2018-04-19 11:46:17 +02:00
parent 3500eb8731
commit c436e7735b
4 changed files with 34 additions and 32 deletions

View File

@@ -54,7 +54,6 @@ import { ExtHostFileSystem } from 'vs/workbench/api/node/extHostFileSystem';
import { ExtHostDecorations } from 'vs/workbench/api/node/extHostDecorations';
import { toGlobPattern, toLanguageSelector } from 'vs/workbench/api/node/extHostTypeConverters';
import { ExtensionActivatedByAPI } from 'vs/workbench/api/node/extHostExtensionActivator';
import { isFalsyOrEmpty } from 'vs/base/common/arrays';
import { OverviewRulerLane } from 'vs/editor/common/model';
import { ExtHostLogService } from 'vs/workbench/api/node/extHostLogService';
import { ExtHostWebviews } from 'vs/workbench/api/node/extHostWebview';
@@ -164,28 +163,6 @@ export function createApiFactory(
};
})();
if (!isFalsyOrEmpty(product.extensionAllowedProposedApi)
&& product.extensionAllowedProposedApi.indexOf(extension.id) >= 0
) {
// fast lane -> proposed api is available to all extensions
// that are listed in product.json-files
extension.enableProposedApi = true;
} else if (extension.enableProposedApi && !extension.isBuiltin) {
if (
!initData.environment.enableProposedApiForAll &&
initData.environment.enableProposedApiFor.indexOf(extension.id) < 0
) {
extension.enableProposedApi = false;
console.error(`Extension '${extension.id} cannot use PROPOSED API (must started out of dev or enabled via --enable-proposed-api)`);
} else {
// proposed api is available when developing or when an extension was explicitly
// spelled out via a command line argument
console.warn(`Extension '${extension.id}' uses PROPOSED API which is subject to change and removal without notice.`);
}
}
// namespace: commands
const commands: typeof vscode.commands = {
registerCommand(id: string, command: <T>(...args: any[]) => T | Thenable<T>, thisArgs?: any): vscode.Disposable {

View File

@@ -52,8 +52,6 @@ import { TaskExecutionDTO, TaskDTO, TaskHandleDTO } from 'vs/workbench/api/share
export interface IEnvironment {
isExtensionDevelopmentDebug: boolean;
enableProposedApiForAll: boolean;
enableProposedApiFor: string | string[];
appRoot: string;
appSettingsHome: string;
disableExtensions: boolean;