Remove validation if LS is shutting down

This commit is contained in:
aboyko
2022-11-23 13:09:15 -05:00
parent a919463ca9
commit 35f4e9899b
2 changed files with 12 additions and 0 deletions

View File

@@ -129,6 +129,12 @@ public class SimpleTextDocumentService implements TextDocumentService, DocumentE
this.appContext = appContext;
this.messageWorkerThreadPool = Executors.newCachedThreadPool();
server.onShutdown(() -> {
for (TextDocument d : getAll()) {
publishDiagnostics(d.getId(), Collections.emptyList());
}
});
}
/**

View File

@@ -179,6 +179,12 @@ public class BootLanguageServerInitializer implements InitializingBean {
server.getWorkspaceService().getFileObserver().onFilesCreated(FILES_TO_WATCH_GLOB, this::handleFiles);
springIndexer.onUpdate(v -> reconcile());
server.onShutdown(() -> {
for (IJavaProject p : projectFinder.all()) {
doNotValidateProject(p);
}
});
}
private void reconcile() {