Skip to content

Commit 52779e0

Browse files
gayanperrgrunber
authored andcommitted
Improve chain completion by waiting for either main or context chains.
This will provide completions from either of the completions processing threads that finish first. Most of the time it will be the main chain completion thread. By doing this we try to minimize the chance we will not get any chain completions when there supposed to be.
1 parent adf0258 commit 52779e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/ChainCompletionProposalComputer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private List<CompletionItem> executeCallChainSearch() {
132132
// ignore
133133
}
134134
}, executor);
135-
CompletableFuture<Void> future = CompletableFuture.allOf(mainChains, contextChains);
135+
CompletableFuture<?> future = CompletableFuture.anyOf(mainChains, contextChains);
136136

137137
long timeout = Long.parseLong(JavaManipulation.getPreference("recommenders.chain.timeout", cu.getJavaProject()));
138138
future.get(timeout, TimeUnit.SECONDS);

0 commit comments

Comments
 (0)