vscode-xml/src/utils/ManifestUtils.ts

34 lines
784 B
TypeScript
Raw Normal View History

2015-11-24 21:44:20 +00:00
'use strict';
2015-11-24 18:59:42 +00:00
import { extensions, Extension } from 'vscode';
export class ExtensionManifestReader {
constructor(extensionId: string) {
this._extension = extensions.getExtension(extensionId);
2015-11-24 22:06:24 +00:00
this.refresh();
2015-11-24 18:59:42 +00:00
}
private _extension: Extension<any>
name: string;
version: string;
publisher: string;
displayName: string;
description: string;
categories: string[];
keywords: string[];
icon: string;
refresh(): void {
2015-11-24 22:06:24 +00:00
let manifest = this._extension.packageJSON;
2015-11-24 18:59:42 +00:00
2015-11-24 23:48:26 +00:00
this.name = manifest.name;
this.version = manifest.version;
this.publisher = manifest.publisher;
2015-11-24 22:06:24 +00:00
this.displayName = manifest.displayName;
2015-11-24 23:48:26 +00:00
this.description = manifest.description;
this.categories = manifest.categories;
this.keywords = manifest.keywords;
this.icon = manifest.icon;
2015-11-24 18:59:42 +00:00
}
}