Skip to content

Commit

Permalink
fix #3991: update settings schema resource on schema changes
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
  • Loading branch information
akosyakov committed Jan 10, 2019
1 parent 0a6abc4 commit 42c4bd2
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ export class PreferencesFrontendApplicationContribution implements FrontendAppli

onStart() {
this.schemaProvider.ready.then(async () => {
const schema = this.schemaProvider.getCombinedSchema();
const serializeSchema = () => JSON.stringify(this.schemaProvider.getCombinedSchema());
const uri = new URI('vscode://schemas/settings/user');
this.inmemoryResources.add(uri, JSON.stringify(schema));
this.inmemoryResources.add(uri, serializeSchema());
this.jsonSchemaStore.registerSchema({
fileMatch: ['.theia/settings.json', USER_PREFERENCE_URI.toString()],
url: uri.toString()
});
this.schemaProvider.onDidPreferencesChanged(() =>
this.inmemoryResources.update(uri, serializeSchema())
);
});
}
}

0 comments on commit 42c4bd2

Please sign in to comment.