未验证 提交 e7d7e9a9 编写于 作者: S Sandeep Somavarapu 提交者: GitHub

Merge pull request #132041 from microsoft/sandy081/fix132034

remove web extension kind
{ {
"name": "code-oss-dev", "name": "code-oss-dev",
"version": "1.60.0", "version": "1.60.0",
"distro": "a60fae6331fa2ff607b18e7b1b20ef0db02430d2", "distro": "0ea9111ff3b92a2070f03c531e3af26435112451",
"author": { "author": {
"name": "Microsoft Corporation" "name": "Microsoft Corporation"
}, },
......
...@@ -97,13 +97,11 @@ const extensionKindSchema: IJSONSchema = { ...@@ -97,13 +97,11 @@ const extensionKindSchema: IJSONSchema = {
type: 'string', type: 'string',
enum: [ enum: [
'ui', 'ui',
'workspace', 'workspace'
'web'
], ],
enumDescriptions: [ enumDescriptions: [
localize('ui', "UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."), localize('ui', "UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."),
localize('workspace', "Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote."), localize('workspace', "Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote.")
localize('web', "Web worker extension kind. Such an extension can execute in a web worker extension host.")
], ],
}; };
......
...@@ -292,7 +292,7 @@ export class ExtensionManifestPropertiesService extends Disposable implements IE ...@@ -292,7 +292,7 @@ export class ExtensionManifestPropertiesService extends Disposable implements IE
result = manifest.extensionKind; result = manifest.extensionKind;
if (typeof result !== 'undefined') { if (typeof result !== 'undefined') {
result = this.toArray(result); result = this.toArray(result);
return result.filter(r => ALL_EXTENSION_KINDS.includes(r)); return result.filter(r => ['ui', 'workspace'].includes(r));
} }
return null; return null;
......
...@@ -148,13 +148,11 @@ const extensionKindSchema: IJSONSchema = { ...@@ -148,13 +148,11 @@ const extensionKindSchema: IJSONSchema = {
type: 'string', type: 'string',
enum: [ enum: [
'ui', 'ui',
'workspace', 'workspace'
'web'
], ],
enumDescriptions: [ enumDescriptions: [
nls.localize('ui', "UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."), nls.localize('ui', "UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."),
nls.localize('workspace', "Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote."), nls.localize('workspace', "Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote."),
nls.localize('web', "Web worker extension kind. Such an extension can execute in a web worker extension host.")
], ],
}; };
......
...@@ -60,6 +60,10 @@ suite('ExtensionManifestPropertiesService - ExtensionKind', () => { ...@@ -60,6 +60,10 @@ suite('ExtensionManifestPropertiesService - ExtensionKind', () => {
assert.deepStrictEqual(testObject.getExtensionKind(<IExtensionManifest>{ main: 'main.js', browser: 'main.browser.js', extensionKind: ['workspace'] }), ['workspace', 'web']); assert.deepStrictEqual(testObject.getExtensionKind(<IExtensionManifest>{ main: 'main.js', browser: 'main.browser.js', extensionKind: ['workspace'] }), ['workspace', 'web']);
}); });
test('only browser entry point with out extensionKind => web', () => {
assert.deepStrictEqual(testObject.getExtensionKind(<IExtensionManifest>{ browser: 'main.browser.js' }), ['web']);
});
test('simple descriptive with workspace, ui extensionKind => workspace, ui, web', () => { test('simple descriptive with workspace, ui extensionKind => workspace, ui, web', () => {
assert.deepStrictEqual(testObject.getExtensionKind(<IExtensionManifest>{ extensionKind: ['workspace', 'ui'] }), ['workspace', 'ui', 'web']); assert.deepStrictEqual(testObject.getExtensionKind(<IExtensionManifest>{ extensionKind: ['workspace', 'ui'] }), ['workspace', 'ui', 'web']);
}); });
...@@ -77,6 +81,14 @@ suite('ExtensionManifestPropertiesService - ExtensionKind', () => { ...@@ -77,6 +81,14 @@ suite('ExtensionManifestPropertiesService - ExtensionKind', () => {
test('extension cannot opt out from web', () => { test('extension cannot opt out from web', () => {
assert.deepStrictEqual(testObject.getExtensionKind(<any>{ browser: 'main.browser.js', extensionKind: ['-web'] }), ['web']); assert.deepStrictEqual(testObject.getExtensionKind(<any>{ browser: 'main.browser.js', extensionKind: ['-web'] }), ['web']);
}); });
test('extension cannot opt into web', () => {
assert.deepStrictEqual(testObject.getExtensionKind(<any>{ main: 'main.js', extensionKind: ['web', 'workspace', 'ui'] }), ['workspace', 'ui']);
});
test('extension cannot opt into web only', () => {
assert.deepStrictEqual(testObject.getExtensionKind(<any>{ main: 'main.js', extensionKind: ['web'] }), []);
});
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册