migrate [bower|package]JSONContributions, #15573

This commit is contained in:
Johannes Rieken
2016-11-17 11:21:29 +01:00
parent edb8abe5ae
commit 739d8ca77f
2 changed files with 12 additions and 12 deletions

View File

@@ -62,11 +62,11 @@ export class BowerJSONContribution implements IJSONContribution {
for (let i = 0; i < results.length; i++) {
let name = results[i].name;
let description = results[i].description || '';
let insertText = JSON.stringify(name);
let insertText = new SnippetString().appendText(JSON.stringify(name));
if (addValue) {
insertText += ': "{{latest}}"';
insertText.appendText(': ').appendPlaceholder('latest');
if (!isLast) {
insertText += ',';
insertText.appendText(',');
}
}
let proposal = new CompletionItem(name);
@@ -91,11 +91,11 @@ export class BowerJSONContribution implements IJSONContribution {
});
} else {
this.topRanked.forEach((name) => {
let insertText = JSON.stringify(name);
let insertText = new SnippetString().appendText(JSON.stringify(name));
if (addValue) {
insertText += ': "{{latest}}"';
insertText.appendText(': ').appendPlaceholder('latest');
if (!isLast) {
insertText += ',';
insertText.appendText(',');
}
}

View File

@@ -65,11 +65,11 @@ export class PackageJSONContribution implements IJSONContribution {
let keys = results[i].key;
if (Array.isArray(keys) && keys.length > 0) {
let name = keys[0];
let insertText = JSON.stringify(name);
let insertText = new SnippetString().appendText(JSON.stringify(name));
if (addValue) {
insertText += ': "{{*}}"';
insertText.appendText(': ').appendPlaceholder('*');
if (!isLast) {
insertText += ',';
insertText.appendText(',');
}
}
let proposal = new CompletionItem(name);
@@ -97,11 +97,11 @@ export class PackageJSONContribution implements IJSONContribution {
});
} else {
this.mostDependedOn.forEach((name) => {
let insertText = JSON.stringify(name);
let insertText = new SnippetString().appendText(JSON.stringify(name));
if (addValue) {
insertText += ': "{{*}}"';
insertText.appendText(': ').appendPlaceholder('*');
if (!isLast) {
insertText += ',';
insertText.appendText(',');
}
}
let proposal = new CompletionItem(name);