Skip to content

Commit 4e9e98a

Browse files
Merge pull request #1338 from DustinCampbell/project-json-triggers
Add '"' and ':' as trigger characters for project.json completion
2 parents 9a25c78 + 5566d5f commit 4e9e98a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/features/json/jsonContributions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export function addJSONProviders(): Disposable {
4545
let contributions = [new ProjectJSONContribution(xhr)];
4646
contributions.forEach(contribution => {
4747
let selector = contribution.getDocumentSelector();
48-
subscriptions.push(languages.registerCompletionItemProvider(selector, new JSONCompletionItemProvider(contribution)));
48+
let triggerCharacters = ['"', ':', '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
49+
subscriptions.push(languages.registerCompletionItemProvider(selector, new JSONCompletionItemProvider(contribution), ...triggerCharacters));
4950
subscriptions.push(languages.registerHoverProvider(selector, new JSONHoverProvider(contribution)));
5051
});
5152

src/features/json/projectJSONContribution.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export class ProjectJSONContribution implements IJSONContribution {
105105
let proposal = new CompletionItem(name);
106106
proposal.kind = CompletionItemKind.Property;
107107
proposal.insertText = insertText;
108+
proposal.filterText = JSON.stringify(name);
108109
result.add(proposal);
109110
}
110111
if (results.length === LIMIT) {

0 commit comments

Comments
 (0)