Skip to content

Commit 71591ae

Browse files
committed
WIP
1 parent d2d7e89 commit 71591ae

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/lib/monaco-editor/json.worker.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,39 @@ class JSONWorker {
5555
},
5656
},
5757
schemaRequestService: createData.enableSchemaRequest ? defaultSchemaRequestService : undefined,
58+
contributions: [
59+
{
60+
async getInfoContribution() {
61+
return [];
62+
},
63+
async collectDefaultCompletions() {
64+
return;
65+
},
66+
async collectPropertyCompletions(uri, location, currentWord, addValue, isLast, result) {
67+
if (location.length === 0 || location[0] !== "customer") {
68+
return;
69+
}
70+
result.add({
71+
label: "Acme, Inc.",
72+
insertText: JSON.stringify(
73+
{
74+
name: "Acme, Inc.",
75+
tax_id: {
76+
country: "ES",
77+
code: "54387763P",
78+
},
79+
},
80+
null,
81+
4
82+
).slice(1, -1), // Strip the surrounding JSON object braces.
83+
});
84+
return;
85+
},
86+
async collectValueCompletions() {
87+
return;
88+
},
89+
},
90+
],
5891
});
5992
this._languageService.configure(this._languageSettings);
6093
}

0 commit comments

Comments
 (0)