Skip to content

Commit

Permalink
Merge pull request #1058 from microsoft/benibenj/potential-narwhal
Browse files Browse the repository at this point in the history
Auto Assign Chat Participant Tag
  • Loading branch information
benibenj authored Sep 30, 2024
2 parents 6e45fcd + bb7be2f commit ba070b6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string[]>(
(r, l) => [...r, `lp-${l.languageId}`, ...toLanguagePackTags(l.translations, l.languageId)],
Expand Down Expand Up @@ -710,6 +711,7 @@ export class TagsProcessor extends BaseProcessor {
...debuggers,
...json,
...remoteMenu,
...chatParticipants,
...localizationContributions,
...languageContributions,
...languageActivations,
Expand Down
16 changes: 16 additions & 0 deletions src/test/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit ba070b6

Please sign in to comment.