[json] set filter text for all property proposals
This commit is contained in:
parent
c72f6120a3
commit
da7264c5b3
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -155,7 +155,7 @@ export class ProjectJSONContribution implements JSONWorkerContribution {
|
|||
insertText += ',';
|
||||
}
|
||||
}
|
||||
let item : CompletionItem = { kind: CompletionItemKind.Property, label: name, insertText: insertText };
|
||||
let item : CompletionItem = { kind: CompletionItemKind.Property, label: name, insertText: insertText, filterText: JSON.stringify(name)};
|
||||
if (!this.completeWithCache(name, item)) {
|
||||
item.data = RESOLVE_ID + name;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue