Skip to content
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

Inspector Implementation #120

Merged
merged 10 commits into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 10 additions & 6 deletions lib/debugger/debugger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ class SourceEditor {

typedef URIDescriber = String Function(String uri);

class BreakpointsView {
class BreakpointsView implements CoreElementView {
BreakpointsView(this._breakpointsCountDiv, DebuggerState debuggerState,
URIDescriber uriDescriber) {
_items = SelectableList<Breakpoint>()
Expand Down Expand Up @@ -1041,6 +1041,7 @@ class BreakpointsView {

Stream<Breakpoint> get onDoubleClick => _items.onDoubleClick;

@override
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 ; there are ~4 more places in this file I believe where we could make the same change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. I've updated them all to implement the CoreElementView interface.

CoreElement get element => _items;

Stream<Breakpoint> get onSelectionChanged => _items.onSelectionChanged;
Expand All @@ -1054,7 +1055,7 @@ class BreakpointsView {
}
}

class ScriptsView {
class ScriptsView implements CoreElementView {
ScriptsView(URIDescriber uriDescriber) {
_items = SelectableList<ScriptRef>()
..flex()
Expand All @@ -1074,9 +1075,9 @@ class ScriptsView {
SelectableList<ScriptRef> _items;

String rootLib;

List<ScriptRef> get items => _items.items;

@override
CoreElement get element => _items;

Stream<ScriptRef> get onSelectionChanged => _items.onSelectionChanged;
Expand Down Expand Up @@ -1135,7 +1136,7 @@ class ScriptsView {
void clearScripts() => _items.clearItems();
}

class CallStackView {
class CallStackView implements CoreElementView{
CallStackView() {
_items = SelectableList<Frame>()
..flex()
Expand Down Expand Up @@ -1179,6 +1180,7 @@ class CallStackView {

List<Frame> get items => _items.items;

@override
CoreElement get element => _items;

Stream<Frame> get onSelectionChanged => _items.onSelectionChanged;
Expand All @@ -1202,7 +1204,7 @@ class CallStackView {

typedef VariableDescriber = Future<String> Function(BoundVariable variable);

class VariablesView {
class VariablesView implements CoreElementView {
VariablesView(VariableDescriber variableDescriber) {
_items = SelectableList<BoundVariable>()
..flex()
Expand Down Expand Up @@ -1258,6 +1260,7 @@ class VariablesView {

List<BoundVariable> get items => _items.items;

@override
CoreElement get element => _items;

void showVariables(Frame frame) {
Expand Down Expand Up @@ -1389,7 +1392,7 @@ int _breakpointComparator(Breakpoint a, Breakpoint b) {
return getPos(a.location) - getPos(b.location);
}

class ConsoleArea {
class ConsoleArea implements CoreElementView {
ConsoleArea() {
final Map<String, dynamic> options = <String, dynamic>{
'mode': 'text/plain',
Expand All @@ -1413,6 +1416,7 @@ class ConsoleArea {
CodeMirror _editor;
ScrollInfo _savedScrollInfo;

@override
CoreElement get element => _container;

void refresh() => _editor.refresh();
Expand Down
2 changes: 2 additions & 0 deletions lib/eval_on_dart_library.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This code is directly based on src/io/flutter/inspector/EvalOnDartLibrary.java
// If you add a method to this class you should also add it to EvalOnDartLibrary.java
import 'dart:async';

import 'package:meta/meta.dart';
Expand Down