Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit bfa142d

Browse files
author
MikhailArkhipov
committed
PR
1 parent 77b22bf commit bfa142d

File tree

1 file changed

+9
-10
lines changed
  • src/LanguageServer/Impl/Implementation

1 file changed

+9
-10
lines changed

src/LanguageServer/Impl/Implementation/Server.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -611,22 +611,14 @@ internal async Task EnqueueItemAsync(IDocument doc, AnalysisPriority priority =
611611
// since otherwise Complete() may come before the change is enqueued
612612
// for processing and the completion list will be driven off the stale data.
613613
var p = pending;
614-
OnDocumentChangeProcessingComplete(doc, cookie as VersionCookie, enqueueForAnalysis, priority, p);
614+
await OnDocumentChangeProcessingCompleteAsync(doc, cookie as VersionCookie, enqueueForAnalysis, priority, p);
615615
pending = null;
616-
617-
if (entry != null) {
618-
var reanalyzeEntries = Analyzer.GetEntriesThatImportModule(entry.ModuleName, false);
619-
foreach (IDocument d in reanalyzeEntries) {
620-
await EnqueueItemAsync(d);
621-
}
622-
}
623-
624616
} finally {
625617
pending?.Dispose();
626618
}
627619
}
628620

629-
private void OnDocumentChangeProcessingComplete(IDocument doc, VersionCookie vc, bool enqueueForAnalysis, AnalysisPriority priority, IDisposable disposeWhenEnqueued) {
621+
private async Task OnDocumentChangeProcessingCompleteAsync(IDocument doc, VersionCookie vc, bool enqueueForAnalysis, AnalysisPriority priority, IDisposable disposeWhenEnqueued) {
630622
try {
631623
_disposableBag.ThrowIfDisposed();
632624
if (vc != null) {
@@ -647,6 +639,13 @@ private void OnDocumentChangeProcessingComplete(IDocument doc, VersionCookie vc,
647639
if (vc != null) {
648640
_editorFiles.GetDocument(doc.DocumentUri).UpdateParseDiagnostics(vc, doc.DocumentUri);
649641
}
642+
643+
if (doc is ProjectEntry entry) {
644+
var reanalyzeEntries = Analyzer.GetEntriesThatImportModule(entry.ModuleName, false);
645+
foreach (IDocument d in reanalyzeEntries) {
646+
await EnqueueItemAsync(d);
647+
}
648+
}
650649
} catch (BadSourceException) {
651650
} catch (ObjectDisposedException) when (_disposableBag.IsDisposed) {
652651
} catch (OperationCanceledException ex) {

0 commit comments

Comments
 (0)