Refactor SchemaRetryNotification to ForceValidateRequest

Now returns the new diagnostics.

Also, actually refresh the schemas instead of just revalidating the
documents. It worked only sometimes before.
This commit is contained in:
Literallie
2018-10-11 22:06:48 +02:00
parent cb8d482429
commit 54f4967761
2 changed files with 27 additions and 16 deletions

View File

@@ -22,8 +22,8 @@ namespace SchemaContentChangeNotification {
export const type: NotificationType<string, any> = new NotificationType('json/schemaContent');
}
namespace SchemaRetryNotification {
export const type: NotificationType<string, any> = new NotificationType('json/schemaRetry');
namespace ForceValidateRequest {
export const type: RequestType<string, Diagnostic[], any, any> = new RequestType('json/validate');
}
export interface ISchemaAssociations {
@@ -171,7 +171,7 @@ export function activate(context: ExtensionContext) {
let handleRetrySchemaCommand = () => {
if (window.activeTextEditor) {
client.sendNotification(SchemaRetryNotification.type, window.activeTextEditor.document.uri.toString());
client.sendRequest(ForceValidateRequest.type, window.activeTextEditor.document.uri.toString());
statusBarItem.text = '$(watch) JSON';
}
};