detect jsonValidation

This commit is contained in:
Joao Moreno 2016-06-01 11:16:06 +02:00
parent b9272419b9
commit 7f5386ef2f
2 changed files with 24 additions and 0 deletions

View file

@ -140,6 +140,7 @@ export class TagsProcessor extends BaseProcessor {
const snippets = contributes && contributes['snippets'] && contributes['snippets'].length > 0 ? ['snippet'] : [];
const keybindings = contributes && contributes['keybindings'] && contributes['keybindings'].length > 0 ? ['keybindings'] : [];
const debuggers = contributes && contributes['debuggers'] && contributes['debuggers'].length > 0 ? ['debuggers'] : [];
const json = contributes && contributes['jsonValidation'] && contributes['jsonValidation'].length > 0 ? ['json'] : [];
const languageContributions = ((contributes && contributes['languages']) || [])
.map(l => l.id);
@ -155,6 +156,7 @@ export class TagsProcessor extends BaseProcessor {
...snippets,
...keybindings,
...debuggers,
...json,
...languageContributions,
...languageActivations
];

View file

@ -565,6 +565,28 @@ describe('toVsixManifest', () => {
assert(tags.some(tag => tag === 'debuggers'));
});
});
it('should detect json validation rules', () => {
const manifest = {
name: 'test',
publisher: 'mocha',
version: '0.0.1',
engines: Object.create(null),
contributes: {
jsonValidation: [{
fileMatch: ".jshintrc",
url: "http://json.schemastore.org/jshintrc"
}]
}
};
return _toVsixManifest(manifest, [])
.then(parseXml)
.then(result => {
const tags = result.PackageManifest.Metadata[0].Tags as string[];
assert(tags.some(tag => tag === 'json'));
});
});
});
describe('toContentTypes', () => {