mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-53012: code folding : trying to fix
This commit is contained in:
@@ -54,26 +54,24 @@ public class FoldingUpdate {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
static Runnable updateFoldRegions(@NotNull final Editor editor, @NotNull final PsiFile file, final boolean applyDefaultState, final boolean quick) {
|
||||
static Runnable updateFoldRegions(@NotNull final Editor editor, @NotNull PsiFile file, final boolean applyDefaultState, final boolean quick) {
|
||||
ApplicationManager.getApplication().assertReadAccessAllowed();
|
||||
|
||||
final Project project = file.getProject();
|
||||
final Document document = editor.getDocument();
|
||||
LOG.assertTrue(!PsiDocumentManager.getInstance(project).isUncommited(document));
|
||||
|
||||
|
||||
CachedValue<Runnable> value = editor.getUserData(CODE_FOLDING_KEY);
|
||||
if (value != null && value.hasUpToDateValue() && !applyDefaultState) return null;
|
||||
if (quick) return getUpdateResult(file, document, quick, project, editor, applyDefaultState).getValue();
|
||||
|
||||
return CachedValuesManager.getManager(project).getCachedValue(editor, CODE_FOLDING_KEY, new CachedValueProvider<Runnable>() {
|
||||
public Result<Runnable> compute() {
|
||||
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
|
||||
Document document = editor.getDocument();
|
||||
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(document);
|
||||
return getUpdateResult(file, document, quick, project, editor, applyDefaultState);
|
||||
}
|
||||
}, false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static CachedValueProvider.Result<Runnable> getUpdateResult(PsiFile file,
|
||||
|
||||
Reference in New Issue
Block a user