Skip to content

Extract evalService from debuggerController that serves console. #4992

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

Merged
merged 42 commits into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
400c40a
-
polina-c Dec 23, 2022
61bd1a2
-
polina-c Dec 23, 2022
1247f0b
-
polina-c Dec 23, 2022
b41aa0a
-
polina-c Dec 23, 2022
309db19
Update expandable_variable.dart
polina-c Dec 24, 2022
e2f387c
-
polina-c Dec 24, 2022
3fc9bed
-
polina-c Dec 24, 2022
15e9aee
-
polina-c Dec 24, 2022
ae40b63
-
polina-c Dec 24, 2022
158c633
-
polina-c Dec 24, 2022
103d4d0
-
polina-c Dec 24, 2022
6d36473
-
polina-c Dec 24, 2022
ee83265
-
polina-c Dec 24, 2022
92bfafa
-
polina-c Dec 24, 2022
c4a9cd0
-
polina-c Dec 24, 2022
72f84fc
-
polina-c Dec 24, 2022
2b33256
-
polina-c Dec 24, 2022
46ea97a
Update console.dart
polina-c Dec 24, 2022
e16dbbb
Update console.dart
polina-c Dec 24, 2022
9cbdb0f
-
polina-c Dec 24, 2022
4a9f2b8
-
polina-c Dec 24, 2022
6e0a4a5
-
polina-c Dec 24, 2022
9253c67
-
polina-c Dec 24, 2022
398e6ca
Update eval_service.dart
polina-c Dec 24, 2022
a259c16
-
polina-c Dec 25, 2022
65a25b6
-
polina-c Dec 25, 2022
85cd166
Update debugger_evaluation_test.dart
polina-c Dec 25, 2022
c1ca478
-
polina-c Dec 25, 2022
c09536b
-
polina-c Dec 25, 2022
86dd969
-
polina-c Dec 25, 2022
593d027
-
polina-c Dec 25, 2022
3f2e729
-
polina-c Dec 26, 2022
27eb226
Update generated_mocks_factories.dart
polina-c Dec 26, 2022
a1048fe
-
polina-c Dec 26, 2022
c431c23
Merge branch 'master' of github.com:flutter/devtools into console2-ev…
polina-c Dec 27, 2022
6d3e9d8
Update eval_service.dart
polina-c Dec 27, 2022
277c29a
-
polina-c Dec 27, 2022
f815d9b
-
polina-c Dec 27, 2022
0b41ed1
Update generated_mocks_factories.dart
polina-c Dec 27, 2022
7bc6cb4
Update debugger_controller.dart
polina-c Dec 27, 2022
a577748
Update debugger_controller.dart
polina-c Dec 28, 2022
7175896
-
polina-c Dec 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/devtools_app/lib/devtools_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export 'src/shared/config_specific/ide_theme/ide_theme.dart';
export 'src/shared/connected_app.dart';
export 'src/shared/console/console_service.dart';
export 'src/shared/console/eval/diagnostics_node.dart';
export 'src/shared/console/eval/eval_service.dart';
export 'src/shared/console/eval/inspector_service.dart';
export 'src/shared/console/eval/inspector_tree.dart';
export 'src/shared/console/primitives/simple_items.dart';
Expand All @@ -70,6 +71,7 @@ export 'src/shared/error_badge_manager.dart';
export 'src/shared/globals.dart';
export 'src/shared/http/http_request_data.dart';
export 'src/shared/notifications.dart';
export 'src/shared/object_tree.dart';
export 'src/shared/preferences.dart';
export 'src/shared/primitives/auto_dispose.dart';
export 'src/shared/primitives/listenable.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1154,8 +1154,8 @@ class _LineItemState extends State<LineItem>

if (word != '') {
try {
final response = await controller.evalAtCurrentFrame(word);
final isolateRef = controller.isolateRef;
final response = await controller.evalService.evalAtCurrentFrame(word);
Copy link
Contributor

Choose a reason for hiding this comment

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

This case is tricky as you wouldn't want any injected variables from the console to show up when evaluating while hovering over source code. Maybe this case should take an extra named parameter like includeConsoleVariables: false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed and agreed evalAtCurrentFrame will never be invoked for global scope.

final isolateRef = controller.isolateRef.value;
if (response is! InstanceRef) return null;
final variable = DartObjectNode.fromValue(
value: response,
Expand Down
7 changes: 4 additions & 3 deletions packages/devtools_app/lib/src/screens/debugger/console.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import 'package:provider/provider.dart';
import '../../shared/common_widgets.dart';
import '../../shared/console/console.dart';
import '../../shared/console/console_service.dart';
import '../../shared/console/widgets/evaluate.dart';
import '../../shared/globals.dart';
import '../../shared/theme.dart';
import 'debugger_controller.dart';
import 'evaluate.dart';

// TODO(devoncarew): Show some small UI indicator when we receive stdout/stderr.

Expand Down Expand Up @@ -69,8 +69,9 @@ class _DebuggerConsoleState extends State<DebuggerConsole> {
footer: SizedBox(
height: consoleLineHeight,
child: ExpressionEvalField(
controller:
Provider.of<DebuggerController>(context, listen: false),
evalService:
Provider.of<DebuggerController>(context, listen: false)
.evalService,
),
),
),
Expand Down
Loading