Skip to content

Commit e06c844

Browse files
authored
[CQ] remove (legacy) Inspector state-persistence (#8170)
Removes old state persistence from the Inspector (now in devtools). --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
1 parent 1673259 commit e06c844

File tree

2 files changed

+5
-101
lines changed

2 files changed

+5
-101
lines changed

flutter-idea/src/io/flutter/view/InspectorView.java

+5-27
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import com.intellij.ide.browsers.BrowserLauncher;
1010
import com.intellij.openapi.Disposable;
1111
import com.intellij.openapi.application.ApplicationManager;
12-
import com.intellij.openapi.components.PersistentStateComponent;
1312
import com.intellij.openapi.components.Storage;
1413
import com.intellij.openapi.diagnostic.Logger;
1514
import com.intellij.openapi.progress.EmptyProgressIndicator;
@@ -43,7 +42,10 @@
4342
import io.flutter.sdk.FlutterSdkVersion;
4443
import io.flutter.settings.FlutterSettings;
4544
import io.flutter.toolwindow.InspectorViewToolWindowManagerListener;
46-
import io.flutter.utils.*;
45+
import io.flutter.utils.AsyncUtils;
46+
import io.flutter.utils.JxBrowserUtils;
47+
import io.flutter.utils.LabelInput;
48+
import io.flutter.utils.OpenApiUtils;
4749
import org.dartlang.vm.service.VmService;
4850
import org.jetbrains.annotations.NotNull;
4951
import org.jetbrains.annotations.Nullable;
@@ -59,7 +61,7 @@
5961
name = "InspectorView",
6062
storages = {@Storage("$WORKSPACE_FILE$")}
6163
)
62-
public class InspectorView implements PersistentStateComponent<InspectorViewState>, Disposable {
64+
public class InspectorView implements Disposable {
6365
private static final Logger LOG = Logger.getInstance(InspectorView.class);
6466

6567
public static final @NotNull String TOOL_WINDOW_ID = "Flutter Inspector";
@@ -71,13 +73,6 @@ public class InspectorView implements PersistentStateComponent<InspectorViewStat
7173
protected static final String DEVTOOLS_FAILED_LABEL = "Setting up DevTools failed.";
7274
protected static final int INSTALLATION_WAIT_LIMIT_SECONDS = 2000;
7375

74-
protected final @NotNull EventStream<Boolean> shouldAutoHorizontalScroll = new EventStream<>(InspectorViewState.AUTO_SCROLL_DEFAULT);
75-
protected final @NotNull EventStream<Boolean> highlightNodesShownInBothTrees =
76-
new EventStream<>(InspectorViewState.HIGHLIGHT_NODES_SHOWN_IN_BOTH_TREES_DEFAULT);
77-
78-
@NotNull
79-
private final InspectorViewState state = new InspectorViewState();
80-
8176
@VisibleForTesting
8277
@NotNull
8378
public final ViewUtils viewUtils;
@@ -106,35 +101,18 @@ protected InspectorView(@NotNull Project project,
106101
this.jxBrowserUtils = jxBrowserUtils;
107102
this.jxBrowserManager = jxBrowserManager;
108103
this.viewUtils = viewUtils != null ? viewUtils : new ViewUtils();
109-
110-
shouldAutoHorizontalScroll.listen(state::setShouldAutoScroll);
111-
highlightNodesShownInBothTrees.listen(state::setHighlightNodesShownInBothTrees);
112104
}
113105

114106
@Override
115107
public void dispose() {
116108
Disposer.dispose(this);
117109
}
118110

119-
@NotNull
120-
@Override
121-
public InspectorViewState getState() {
122-
return state;
123-
}
124-
125111
@NotNull
126112
public Project getProject() {
127113
return myProject;
128114
}
129115

130-
@Override
131-
public void loadState(@NotNull InspectorViewState state) {
132-
this.state.copyFrom(state);
133-
134-
shouldAutoHorizontalScroll.setValue(this.state.getShouldAutoScroll());
135-
highlightNodesShownInBothTrees.setValue(this.state.getHighlightNodesShownInBothTrees());
136-
}
137-
138116
void initToolWindow(@NotNull ToolWindow window) {
139117
if (window.isDisposed()) return;
140118

flutter-idea/src/io/flutter/view/InspectorViewState.java

-74
This file was deleted.

0 commit comments

Comments
 (0)