Add SchemaRetry notification to jsonServerMain

This commit is contained in:
Literallie 2018-10-11 00:16:52 +02:00
parent 27ce1616ca
commit 7814f38222
No known key found for this signature in database
GPG key ID: 7BE463C902ED152C

View file

@ -34,6 +34,10 @@ namespace SchemaContentChangeNotification {
export const type: NotificationType<string, any> = new NotificationType('json/schemaContent');
}
namespace SchemaRetryNotification {
export const type: NotificationType<string, any> = new NotificationType('json/schemaRetry');
}
// Create a connection for the server
const connection: IConnection = createConnection();
@ -207,6 +211,14 @@ connection.onNotification(SchemaContentChangeNotification.type, uri => {
languageService.resetSchema(uri);
});
// Retry schema validation on all open documents
connection.onNotification(SchemaRetryNotification.type, uri => {
const document = documents.get(uri);
if (document) {
triggerValidation(document);
}
});
function updateConfiguration() {
const languageSettings = {
validate: true,
@ -405,4 +417,4 @@ connection.onFoldingRanges((params, token) => {
});
// Listen on the connection
connection.listen();
connection.listen();