extensions - wire in proposed API enablement (for #92908)
parent
0a3d67adee
commit
9bd87e3852
|
@ -146,6 +146,7 @@ export interface IEnvironmentService extends IUserHomeProvider {
|
|||
extensionsPath?: string;
|
||||
extensionDevelopmentLocationURI?: URI[];
|
||||
extensionTestsLocationURI?: URI;
|
||||
extensionEnabledProposedApi?: string[] | undefined;
|
||||
logExtensionHostCommunication?: boolean;
|
||||
|
||||
debugExtensionHost: IExtensionHostDebugParams;
|
||||
|
|
|
@ -233,6 +233,18 @@ export class EnvironmentService implements IEnvironmentService {
|
|||
return false;
|
||||
}
|
||||
|
||||
get extensionEnabledProposedApi(): string[] | undefined {
|
||||
if (Array.isArray(this.args['enable-proposed-api'])) {
|
||||
return this.args['enable-proposed-api'];
|
||||
}
|
||||
|
||||
if ('enable-proposed-api' in this.args) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@memoize
|
||||
get debugExtensionHost(): IExtensionHostDebugParams { return parseExtensionHostPort(this._args, this.isBuilt); }
|
||||
@memoize
|
||||
|
|
|
@ -69,6 +69,7 @@ interface IExtensionHostDebugEnvironment {
|
|||
isExtensionDevelopment: boolean;
|
||||
extensionDevelopmentLocationURI?: URI[];
|
||||
extensionTestsLocationURI?: URI;
|
||||
extensionEnabledProposedApi?: string[];
|
||||
}
|
||||
|
||||
export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironmentService {
|
||||
|
@ -156,6 +157,14 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
|
|||
return this._extensionHostDebugEnvironment.extensionTestsLocationURI;
|
||||
}
|
||||
|
||||
get extensionEnabledProposedApi(): string[] | undefined {
|
||||
if (!this._extensionHostDebugEnvironment) {
|
||||
this._extensionHostDebugEnvironment = this.resolveExtensionHostDebugEnvironment();
|
||||
}
|
||||
|
||||
return this._extensionHostDebugEnvironment.extensionEnabledProposedApi;
|
||||
}
|
||||
|
||||
@memoize
|
||||
get webviewExternalEndpoint(): string {
|
||||
// TODO: get fallback from product.json
|
||||
|
@ -216,6 +225,9 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
|
|||
extensionHostDebugEnvironment.params.port = parseInt(value);
|
||||
extensionHostDebugEnvironment.params.break = true;
|
||||
break;
|
||||
case 'enableProposedApi':
|
||||
extensionHostDebugEnvironment.extensionEnabledProposedApi = [];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -457,12 +457,12 @@ class ProposedApiController {
|
|||
@IProductService productService: IProductService
|
||||
) {
|
||||
// Make enabled proposed API be lowercase for case insensitive comparison
|
||||
this.enableProposedApiFor = (environmentService.args['enable-proposed-api'] || []).map(id => id.toLowerCase());
|
||||
this.enableProposedApiFor = (environmentService.extensionEnabledProposedApi || []).map(id => id.toLowerCase());
|
||||
|
||||
this.enableProposedApiForAll =
|
||||
!environmentService.isBuilt || // always allow proposed API when running out of sources
|
||||
(!!environmentService.extensionDevelopmentLocationURI && productService.quality !== 'stable') || // do not allow proposed API against stable builds when developing an extension
|
||||
(this.enableProposedApiFor.length === 0 && 'enable-proposed-api' in environmentService.args); // always allow proposed API if --enable-proposed-api is provided without extension ID
|
||||
(this.enableProposedApiFor.length === 0 && Array.isArray(environmentService.extensionEnabledProposedApi)); // always allow proposed API if --enable-proposed-api is provided without extension ID
|
||||
|
||||
this.productAllowProposedApi = new Set<string>();
|
||||
if (isNonEmptyArray(productService.extensionAllowedProposedApi)) {
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as path from 'path';
|
||||
import * as cp from 'child_process';
|
||||
import * as playwright from 'playwright';
|
||||
import * as url from 'url';
|
||||
import * as tmp from 'tmp';
|
||||
import * as rimraf from 'rimraf';
|
||||
import * as path from 'path';
|
||||
import * as cp from 'child_process';
|
||||
import * as playwright from 'playwright';
|
||||
import * as url from 'url';
|
||||
import * as tmp from 'tmp';
|
||||
import * as rimraf from 'rimraf';
|
||||
import { URI } from 'vscode-uri';
|
||||
import * as kill from 'tree-kill';
|
||||
import * as optimistLib from 'optimist';
|
||||
|
@ -44,7 +44,7 @@ async function runTestsInBrowser(browserType: 'chromium' | 'firefox' | 'webkit',
|
|||
const testFilesUri = url.format({ pathname: URI.file(path.resolve(optimist.argv.extensionTestsPath)).path, protocol, host, slashes: true });
|
||||
|
||||
const folderParam = testWorkspaceUri;
|
||||
const payloadParam = `[["extensionDevelopmentPath","${testExtensionUri}"],["extensionTestsPath","${testFilesUri}"]]`;
|
||||
const payloadParam = `[["extensionDevelopmentPath","${testExtensionUri}"],["extensionTestsPath","${testFilesUri}"],["enableProposedApi",""]]`;
|
||||
|
||||
await page.goto(`${endpoint.href}&folder=${folderParam}&payload=${payloadParam}`);
|
||||
|
||||
|
|
Loading…
Reference in New Issue