Lots of borders in package.json hover. Fixes #14526

This commit is contained in:
Martin Aeschlimann
2016-11-04 10:46:50 +01:00
parent ebd2a0126e
commit 85887c2de6
2 changed files with 6 additions and 10 deletions

View File

@@ -170,13 +170,11 @@ export class BowerJSONContribution implements IJSONContribution {
if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']))) {
let pack = location.path[location.path.length - 1];
if (typeof pack === 'string') {
let htmlContent: MarkedString[] = [];
htmlContent.push(localize('json.bower.package.hover', '{0}', pack));
return this.getInfo(pack).then(documentation => {
if (documentation) {
htmlContent.push(textToMarkedString(documentation));
return [textToMarkedString(documentation)];
}
return htmlContent;
return null;
});
}
}

View File

@@ -211,13 +211,11 @@ export class PackageJSONContribution implements IJSONContribution {
if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']) || location.matches(['optionalDependencies', '*']) || location.matches(['peerDependencies', '*']))) {
let pack = location.path[location.path.length - 1];
if (typeof pack === 'string') {
let htmlContent: MarkedString[] = [];
htmlContent.push(localize('json.npm.package.hover', '{0}', pack));
return this.getInfo(pack).then(infos => {
infos.forEach(info => {
htmlContent.push(textToMarkedString(info));
});
return htmlContent;
if (infos.length) {
return [infos.map(textToMarkedString).join('\n\n')];
}
return null;
});
}
}