Listen to schema change events (for #27816)

This commit is contained in:
Martin Aeschlimann
2017-09-25 12:40:11 +02:00
parent 9279711645
commit 8b350a162c
2 changed files with 26 additions and 6 deletions

View File

@@ -35,6 +35,10 @@ namespace VSCodeContentRequest {
export const type: RequestType<string, string, any, any> = new RequestType('vscode/content');
}
namespace SchemaContentChangeNotification {
export const type: NotificationType<string, any> = new NotificationType('json/schemaContent');
}
// Create a connection for the server
let connection: IConnection = createConnection();
@@ -172,6 +176,11 @@ connection.onNotification(SchemaAssociationNotification.type, associations => {
updateConfiguration();
});
// A schema has changed
connection.onNotification(SchemaContentChangeNotification.type, uri => {
languageService.resetSchema(uri);
});
function updateConfiguration() {
let languageSettings: LanguageSettings = {
validate: true,