From bb7be2fd48eee63e99c4423dada49c9ac9f9460c Mon Sep 17 00:00:00 2001 From: BeniBenj Date: Fri, 27 Sep 2024 17:09:03 +0200 Subject: [PATCH] Auto Assign Chat Participant Tag --- src/package.ts | 2 ++ src/test/package.test.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/package.ts b/src/package.ts index 682deff3..d960f155 100644 --- a/src/package.ts +++ b/src/package.ts @@ -670,6 +670,7 @@ export class TagsProcessor extends BaseProcessor { const debuggers = doesContribute('debuggers') ? ['debuggers'] : []; const json = doesContribute('jsonValidation') ? ['json'] : []; const remoteMenu = doesContribute('menus', 'statusBar/remoteIndicator') ? ['remote-menu'] : []; + const chatParticipants = doesContribute('chatParticipants') ? ['chat-participant'] : []; const localizationContributions = ((contributes && contributes['localizations']) ?? []).reduce( (r, l) => [...r, `lp-${l.languageId}`, ...toLanguagePackTags(l.translations, l.languageId)], @@ -710,6 +711,7 @@ export class TagsProcessor extends BaseProcessor { ...debuggers, ...json, ...remoteMenu, + ...chatParticipants, ...localizationContributions, ...languageContributions, ...languageActivations, diff --git a/src/test/package.test.ts b/src/test/package.test.ts index 11b4d444..f1cf1962 100644 --- a/src/test/package.test.ts +++ b/src/test/package.test.ts @@ -1332,6 +1332,22 @@ describe('toVsixManifest', () => { .then(result => assert.deepEqual(result.PackageManifest.Metadata[0].Tags[0], 'snippet,__web_extension')); }); + it('should automatically add chatParticipant tag', () => { + const manifest = { + name: 'test', + publisher: 'mocha', + version: '0.0.1', + engines: Object.create(null), + contributes: { + chatParticipants: [{ name: 'test', id: 'test' }], + }, + }; + + return _toVsixManifest(manifest, []) + .then(parseXmlManifest) + .then(result => assert.deepEqual(result.PackageManifest.Metadata[0].Tags[0], 'chat-participant,__web_extension')); + }); + it('should remove duplicate tags', () => { const manifest = { name: 'test',