-
Notifications
You must be signed in to change notification settings - Fork 330
add the ability to install and open DevTools #3207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
public void onCancel() { | ||
if (processHandler != null && !processHandler.isProcessTerminated()) { | ||
processHandler.destroyProcess(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "result.complete(false);" ? Can't remember if "processHandler.waitFor()" will return false if canceled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this (and guarded against completing something that's already completed).
public CompletableFuture<Boolean> installDevTools() { | ||
final FlutterSdk sdk = FlutterSdk.getFlutterSdk(project); | ||
if (sdk == null) { | ||
final CompletableFuture<Boolean> result = new CompletableFuture<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 58-60 are frequently repeated. Could do a helper like "return falseLater();"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point; done (created createCompletedFuture(boolean value)
).
|
||
private boolean installedDevTools = false; | ||
|
||
DevToolsInstance devToolsInstance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/io/flutter/view/FlutterView.java
Outdated
} | ||
} | ||
|
||
class OpenDevToolsAction extends FlutterViewAction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be unified with io.flutter.run.OpenDevToolsAction? If not, I'd prefer a different name for one of these action classes. E.g. OpenDevToolsMenuAction here or OpenDevToolsToolbarAction there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bunch of overlap. It's slightly easier to have code dupe for these two classes, rather than trying to unify them; I renamed the one specific to the Flutter view to FlutterViewDevToolsAction
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! Updated.
|
||
private boolean installedDevTools = false; | ||
|
||
DevToolsInstance devToolsInstance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
public CompletableFuture<Boolean> installDevTools() { | ||
final FlutterSdk sdk = FlutterSdk.getFlutterSdk(project); | ||
if (sdk == null) { | ||
final CompletableFuture<Boolean> result = new CompletableFuture<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point; done (created createCompletedFuture(boolean value)
).
public void onCancel() { | ||
if (processHandler != null && !processHandler.isProcessTerminated()) { | ||
processHandler.destroyProcess(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this (and guarded against completing something that's already completed).
src/io/flutter/view/FlutterView.java
Outdated
} | ||
} | ||
|
||
class OpenDevToolsAction extends FlutterViewAction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a bunch of overlap. It's slightly easier to have code dupe for these two classes, rather than trying to unify them; I renamed the one specific to the Flutter view to FlutterViewDevToolsAction
.
LGTM :) |
* add the ability to install and open DevTools * review comments
Add the ability to install and open DevTools:
pub global activate
the devtools packags