mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
(part of IJPL-222955) cleanup: avoid negative named methods
GitOrigin-RevId: 302f2b836b4a4452702d2904cb07516b3deeab80
This commit is contained in:
committed by
intellij-monorepo-bot
parent
33b2bbaadb
commit
3d04daabc9
+13
-5
@@ -53,7 +53,7 @@ public final class CodeFoldingManagerImpl extends CodeFoldingManager implements
|
||||
private static final Key<Map<TextRange, Boolean>> ASYNC_FOLDING_CACHE_KEY = Key.create("ASYNC_FOLDING_CACHE");
|
||||
private static final Key<Boolean> AUTO_CREATED_KEY = Key.create("AUTO_CREATED");
|
||||
private static final Key<Boolean> FRONTEND_CREATED_KEY = Key.create("FRONTEND_CREATED");
|
||||
private static final Key<Boolean> NOT_PERSISTENT = Key.create("NOT_PERSISTENT");
|
||||
private static final Key<Boolean> TRANSIENT_KEY = Key.create("TRANSIENT");
|
||||
|
||||
private final Project myProject;
|
||||
private final Collection<Document> myDocumentsWithFoldingInfo = new WeakList<>();
|
||||
@@ -229,12 +229,20 @@ public final class CodeFoldingManagerImpl extends CodeFoldingManager implements
|
||||
}
|
||||
|
||||
/// Do not store the folding region in user config
|
||||
public static void markAsNotPersistent(@NotNull FoldRegion region) {
|
||||
NOT_PERSISTENT.set(region, true);
|
||||
public static void markTransient(@NotNull FoldRegion region) {
|
||||
TRANSIENT_KEY.set(region, true);
|
||||
}
|
||||
|
||||
static boolean isNotPersistent(@Nullable FoldRegion region) {
|
||||
return NOT_PERSISTENT.isIn(region);
|
||||
/**
|
||||
* @deprecated use {@link #markTransient(FoldRegion)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static void markAsNotPersistent(@NotNull FoldRegion region) {
|
||||
markTransient(region);
|
||||
}
|
||||
|
||||
static boolean isTransient(@Nullable FoldRegion region) {
|
||||
return TRANSIENT_KEY.isIn(region);
|
||||
}
|
||||
|
||||
public static Map<TextRange, Boolean> getAsyncExpandStatusMap(@Nullable Editor editor) {
|
||||
|
||||
+6
-2
@@ -68,10 +68,14 @@ final class DocumentFoldingInfo implements CodeFoldingState {
|
||||
|
||||
FoldRegion[] foldRegions = editor.getFoldingModel().getAllFoldRegions();
|
||||
for (FoldRegion region : foldRegions) {
|
||||
if (!region.isValid() || region.shouldNeverExpand() || CodeFoldingManagerImpl.isNotPersistent(region)) continue;
|
||||
if (!region.isValid() || region.shouldNeverExpand() || CodeFoldingManagerImpl.isTransient(region)) {
|
||||
continue;
|
||||
}
|
||||
boolean expanded = region.isExpanded();
|
||||
String signature = region.getUserData(UpdateFoldRegionsOperation.SIGNATURE);
|
||||
if (Strings.areSameInstance(signature, UpdateFoldRegionsOperation.NO_SIGNATURE)) continue;
|
||||
if (Strings.areSameInstance(signature, UpdateFoldRegionsOperation.NO_SIGNATURE)) {
|
||||
continue;
|
||||
}
|
||||
Boolean storedCollapseByDefault = CodeFoldingManagerImpl.getCollapsedByDef(region);
|
||||
boolean collapseByDefault = storedCollapseByDefault != null && storedCollapseByDefault &&
|
||||
!FoldingUtil.caretInsideRange(editor, region.getTextRange());
|
||||
|
||||
Reference in New Issue
Block a user