Skip to content

Commit

Permalink
IDEA-304157 release unresolved refs job reference when provider throw…
Browse files Browse the repository at this point in the history
…s exception (PCE)

GitOrigin-RevId: 7dd54711f9a052adffd40951aef97b889b185d3c
  • Loading branch information
kaleev authored and intellij-monorepo-bot committed Nov 18, 2022
1 parent f341d28 commit 5cb0956
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,22 @@ private Job<?> startUnresolvedRefsJob(@NotNull HighlightInfo info, @NotNull Edit
return;
}
AtomicBoolean changed = new AtomicBoolean();
UnresolvedReferenceQuickFixProvider.registerReferenceFixes(reference, new QuickFixActionRegistrarImpl(info) {
@Override
void doRegister(@NotNull IntentionAction action,
@Nls(capitalization = Nls.Capitalization.Sentence) @Nullable String displayName,
@Nullable TextRange fixRange,
@Nullable HighlightDisplayKey key) {
super.doRegister(action, displayName, fixRange, key);
changed.set(true);
}
});
info.setUnresolvedReferenceQuickFixesComputed();
reference.getElement().putUserData(JOB, null);
try {
UnresolvedReferenceQuickFixProvider.registerReferenceFixes(reference, new QuickFixActionRegistrarImpl(info) {
@Override
void doRegister(@NotNull IntentionAction action,
@Nls(capitalization = Nls.Capitalization.Sentence) @Nullable String displayName,
@Nullable TextRange fixRange,
@Nullable HighlightDisplayKey key) {
super.doRegister(action, displayName, fixRange, key);
changed.set(true);
}
});
info.setUnresolvedReferenceQuickFixesComputed();
}
finally {
reference.getElement().putUserData(JOB, null);
}
if (changed.get()) {
VirtualFile virtualFile = file.getVirtualFile();
boolean isInContent = ModuleUtilCore.projectContainsFile(myProject, virtualFile, false);
Expand Down

0 comments on commit 5cb0956

Please sign in to comment.