Skip to content

Commit

Permalink
Give ResponseStore for code actions a minimum history size of 8.
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-vanderheijden authored and rgrunber committed Jun 24, 2024
1 parent 8b9892c commit 2c218e4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@
import com.google.gson.JsonElement;

public class CodeActionHandler {
// Store a few of the latest Code Action results because any one of them might be resolved further.
// Multiple Code Actions are computed in parallel through ForkJoinPool's common pool leading to a race condition where
// the last Code Action request to finish processing is not the client's latest request. History size must scale with pool size.
public static final ResponseStore<Either<ChangeCorrectionProposalCore, CodeActionProposal>> codeActionStore
= new ResponseStore<>(ForkJoinPool.commonPool().getParallelism());
= new ResponseStore<>(Math.max(ForkJoinPool.getCommonPoolParallelism(), 8));
public static final String COMMAND_ID_APPLY_EDIT = "java.apply.workspaceEdit";

public static CodeActionOptions createOptions(PreferenceManager preferenceManager) {
Expand Down

0 comments on commit 2c218e4

Please sign in to comment.