mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 13:03:42 +01:00
[json] set filter text for all property proposals
This commit is contained in:
@@ -71,6 +71,7 @@ export class BowerJSONContribution implements IJSONContribution {
|
||||
let proposal = new CompletionItem(name);
|
||||
proposal.kind = CompletionItemKind.Property;
|
||||
proposal.insertText = insertText;
|
||||
proposal.filterText = JSON.stringify(name);
|
||||
proposal.documentation = description;
|
||||
collector.add(proposal);
|
||||
}
|
||||
@@ -100,6 +101,7 @@ export class BowerJSONContribution implements IJSONContribution {
|
||||
let proposal = new CompletionItem(name);
|
||||
proposal.kind = CompletionItemKind.Property;
|
||||
proposal.insertText = insertText;
|
||||
proposal.filterText = JSON.stringify(name);
|
||||
proposal.documentation = '';
|
||||
collector.add(proposal);
|
||||
});
|
||||
@@ -115,6 +117,7 @@ export class BowerJSONContribution implements IJSONContribution {
|
||||
// not implemented. Could be do done calling the bower command. Waiting for web API: https://github.com/bower/registry/issues/26
|
||||
let proposal = new CompletionItem(localize('json.bower.latest.version', 'latest'));
|
||||
proposal.insertText = '"{{latest}}"';
|
||||
proposal.filterText = '""';
|
||||
proposal.kind = CompletionItemKind.Value;
|
||||
proposal.documentation = 'The latest version of the package';
|
||||
collector.add(proposal);
|
||||
|
||||
@@ -101,7 +101,6 @@ export class JSONCompletionItemProvider implements CompletionItemProvider {
|
||||
} else {
|
||||
overwriteRange = new Range(document.positionAt(offset - currentWord.length), position);
|
||||
}
|
||||
let filterText = document.getText(new Range(overwriteRange.start, position));
|
||||
|
||||
let proposed: { [key: string]: boolean } = {};
|
||||
let collector: ISuggestionsCollector = {
|
||||
@@ -109,8 +108,6 @@ export class JSONCompletionItemProvider implements CompletionItemProvider {
|
||||
if (!proposed[suggestion.label]) {
|
||||
proposed[suggestion.label] = true;
|
||||
suggestion.textEdit = TextEdit.replace(overwriteRange, suggestion.insertText);
|
||||
suggestion.filterText = filterText;
|
||||
|
||||
items.push(suggestion);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -74,6 +74,7 @@ export class PackageJSONContribution implements IJSONContribution {
|
||||
let proposal = new CompletionItem(name);
|
||||
proposal.kind = CompletionItemKind.Property;
|
||||
proposal.insertText = insertText;
|
||||
proposal.filterText = JSON.stringify(name);
|
||||
proposal.documentation = '';
|
||||
collector.add(proposal);
|
||||
}
|
||||
@@ -105,6 +106,7 @@ export class PackageJSONContribution implements IJSONContribution {
|
||||
let proposal = new CompletionItem(name);
|
||||
proposal.kind = CompletionItemKind.Property;
|
||||
proposal.insertText = insertText;
|
||||
proposal.filterText = JSON.stringify(name);
|
||||
proposal.documentation = '';
|
||||
collector.add(proposal);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user