mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 02:58:31 -05:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -49,8 +49,9 @@ class ExtensionManifestParser extends ExtensionManifestHandler {
|
||||
|
||||
public parse(): Promise<IExtensionDescription> {
|
||||
return pfs.readFile(this._absoluteManifestPath).then((manifestContents) => {
|
||||
try {
|
||||
const manifest = JSON.parse(manifestContents.toString());
|
||||
const errors: json.ParseError[] = [];
|
||||
const manifest = json.parse(manifestContents.toString(), errors);
|
||||
if (errors.length === 0) {
|
||||
if (manifest.__metadata) {
|
||||
manifest.uuid = manifest.__metadata.id;
|
||||
}
|
||||
@@ -60,8 +61,10 @@ class ExtensionManifestParser extends ExtensionManifestHandler {
|
||||
}
|
||||
delete manifest.__metadata;
|
||||
return manifest;
|
||||
} catch (e) {
|
||||
this._log.error(this._absoluteFolderPath, nls.localize('jsonParseFail', "Failed to parse {0}: {1}.", this._absoluteManifestPath, getParseErrorMessage(e.message)));
|
||||
} else {
|
||||
errors.forEach(e => {
|
||||
this._log.error(this._absoluteFolderPath, nls.localize('jsonParseFail', "Failed to parse {0}: [{1}, {2}] {3}.", this._absoluteManifestPath, e.offset, e.length, getParseErrorMessage(e.error)));
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}, (err) => {
|
||||
|
||||
Reference in New Issue
Block a user