DiagnosticsSupport for json and html

This commit is contained in:
Martin Aeschlimann
2022-05-19 22:27:28 +02:00
parent aacb387ef1
commit 49944b1501
6 changed files with 87 additions and 75 deletions

View File

@@ -58,8 +58,6 @@ export function registerDiagnosticsPushSupport(documents: TextDocuments<TextDocu
}, validationDelayMs);
}
documents.all().forEach(triggerValidation);
return {
requestRefresh: () => {
documents.all().forEach(triggerValidation);
@@ -85,7 +83,7 @@ export function registerDiagnosticsPullSupport(documents: TextDocuments<TextDocu
};
}
connection.languages.diagnostics.on(async (params: DocumentDiagnosticParams, token: CancellationToken) => {
const registration = connection.languages.diagnostics.on(async (params: DocumentDiagnosticParams, token: CancellationToken) => {
return runSafeAsync(runtime, async () => {
const document = documents.get(params.textDocument.uri);
if (document) {
@@ -103,6 +101,7 @@ export function registerDiagnosticsPullSupport(documents: TextDocuments<TextDocu
return {
requestRefresh,
dispose: () => {
registration.dispose();
}
};