Skip to content

Give ResponseStore for codeactions a minimum history size of 8 #3194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading