Skip to content

Commit

Permalink
Prevent caching outdated AST in CoreASTProvider (#2714)
Browse files Browse the repository at this point in the history
Attempt to prevent caching outdated AST in CoreASTProvider

Signed-off-by: Odin Dahlström <zerodind@gmail.com>
  • Loading branch information
0dinD committed Jul 20, 2023
1 parent 9c2a29d commit c22b229
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -426,7 +426,13 @@ public ICompilationUnit handleChanged(DidChangeTextDocumentParams params) {

try {
if (unit.equals(sharedASTProvider.getActiveJavaElement())) {
// We call clearReconciliation here in an attempt to prevent getAST calls on other threads
// from caching outdated AST after we just called disposeAST. See also:
// https://github.com/eclipse/eclipse.jdt.ls/issues/1918
// https://github.com/eclipse/eclipse.jdt.ls/pull/2714#discussion_r1234817900
sharedASTProvider.clearReconciliation();
sharedASTProvider.disposeAST();
sharedASTProvider.clearReconciliation();
CodeActionHandler.codeActionStore.clear();
}

Expand Down

0 comments on commit c22b229

Please sign in to comment.