Skip to content

Commit

Permalink
Register documentcontentsynchronizer as prenotified listener. Will be…
Browse files Browse the repository at this point in the history
… called before reconcilers installed via addDocumentListener
  • Loading branch information
zulus authored and mickaelistria committed Sep 19, 2023
1 parent 32fd663 commit 5aab9c6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ private boolean supportsWorkspaceFolderCapability() {
TextDocumentSyncKind syncKind = initializeFuture == null ? null
: serverCapabilities.getTextDocumentSync().map(Functions.identity(), TextDocumentSyncOptions::getChange);
final var listener = new DocumentContentSynchronizer(this, languageServer, theDocument, syncKind);
theDocument.addDocumentListener(listener);
theDocument.addPrenotifiedDocumentListener(listener);
LanguageServerWrapper.this.connectedDocuments.put(uri, listener);
}
}).thenApply(theVoid -> this);
Expand All @@ -618,7 +618,7 @@ public CompletableFuture<Void> disconnect(URI uri) {
DocumentContentSynchronizer documentListener = this.connectedDocuments.remove(uri);
CompletableFuture<Void> documentClosedFuture = null;
if (documentListener != null) {
documentListener.getDocument().removeDocumentListener(documentListener);
documentListener.getDocument().removePrenotifiedDocumentListener(documentListener);
documentClosedFuture = documentListener.documentClosed();
}
if (this.connectedDocuments.isEmpty()) {
Expand Down

0 comments on commit 5aab9c6

Please sign in to comment.