提交 2e618308 编写于 作者: R Rob Lourens

Exclude extensions that only contribute themes from the extension list - #27987

上级 acfc6b6e
......@@ -6,6 +6,7 @@
'use strict';
import URI from 'vs/base/common/uri';
import * as collections from 'vs/base/common/collections';
import { TPromise } from 'vs/base/common/winjs.base';
import { Action } from 'vs/base/common/actions';
import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService';
......@@ -721,8 +722,17 @@ Steps to Reproduce:
}
private generateExtensionTable(extensions: ILocalExtension[]): string {
const { nonThemes, themes } = collections.groupBy(extensions, ext => {
const manifestKeys = ext.manifest.contributes ? Object.keys(ext.manifest.contributes) : [];
const onlyTheme = !ext.manifest.activationEvents && manifestKeys.length === 1 && manifestKeys[0] === 'themes';
return onlyTheme ? 'themes' : 'nonThemes';
});
const themeExclusionStr = themes.length ? `\n(${themes.length} theme extensions excluded)` : '';
extensions = nonThemes;
if (!extensions.length) {
return 'none';
return 'none' + themeExclusionStr;
}
let tableHeader = `Extension|Author|Version
......@@ -735,8 +745,10 @@ Steps to Reproduce:
${tableHeader}
${table}
${themeExclusionStr}
`;
// 2000 chars is browsers de-facto limit for URLs, 400 chars are allowed for other string parts of the issue URL
// http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers
if (encodeURIComponent(extensionTable).length > 1600) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册