mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
migrate [bower|package]JSONContributions, #15573
This commit is contained in:
@@ -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(',');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user