parent
9fb88a3aad
commit
63c927ca36
1 changed files with 41 additions and 51 deletions
|
@ -285,17 +285,6 @@ export class TagsProcessor extends BaseProcessor {
|
|||
|
||||
onEnd(): Promise<void> {
|
||||
const keywords = this.manifest.keywords || [];
|
||||
const trimmedKeywords = keywords.filter((keyword, index) => index < 5 || keyword === 'multi-root ready');
|
||||
|
||||
let promise = Promise.resolve(trimmedKeywords);
|
||||
|
||||
if (keywords.length !== trimmedKeywords.length && !process.env['VSCE_IGNORE_KEYWORDS_LENGTH']) {
|
||||
console.warn(`The keyword list is limited to 5 keywords; only the following keywords will be in your extension: ${trimmedKeywords.join(', ')}.`);
|
||||
promise = util.read('Do you want to continue? [y/N] ')
|
||||
.then(answer => /^y$/i.test(answer) ? Promise.resolve(trimmedKeywords) : Promise.reject('Aborted'));
|
||||
}
|
||||
|
||||
return promise.then<any>(keywords => {
|
||||
const contributes = this.manifest.contributes;
|
||||
const activationEvents = this.manifest.activationEvents || [];
|
||||
const doesContribute = name => contributes && contributes[name] && contributes[name].length > 0;
|
||||
|
@ -325,7 +314,7 @@ export class TagsProcessor extends BaseProcessor {
|
|||
const descriptionKeywords = Object.keys(TagsProcessor.Keywords)
|
||||
.reduce((r, k) => r.concat(new RegExp('\\b(?:' + escapeRegExp(k) + ')(?!\\w)', 'gi').test(description) ? TagsProcessor.Keywords[k] : []), []);
|
||||
|
||||
keywords = [
|
||||
const tags = [
|
||||
...keywords,
|
||||
...colorThemes,
|
||||
...iconThemes,
|
||||
|
@ -340,11 +329,12 @@ export class TagsProcessor extends BaseProcessor {
|
|||
...descriptionKeywords
|
||||
];
|
||||
|
||||
this.vsix.tags = _(keywords)
|
||||
this.vsix.tags = _(tags)
|
||||
.uniq() // deduplicate
|
||||
.compact() // remove falsey values
|
||||
.join(',');
|
||||
});
|
||||
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue