Skip to content

Commit d75d1f6

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Migrate FlutterOutlineComputer.
Change-Id: I377de846b5400cbd8525dc41f52909a3a1734dc2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391240 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent a92ef52 commit d75d1f6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

pkg/analysis_server/analyzer_use_new_elements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ lib/src/domains/analysis/occurrences.dart
4747
lib/src/domains/completion/available_suggestions.dart
4848
lib/src/domains/execution/completion.dart
4949
lib/src/flutter/flutter_notifications.dart
50+
lib/src/flutter/flutter_outline_computer.dart
5051
lib/src/g3/fixes.dart
5152
lib/src/g3/utilities.dart
5253
lib/src/handler/legacy/analysis_get_errors.dart
@@ -1499,14 +1500,14 @@ tool/code_completion/benchmark/flutter.dart
14991500
tool/code_completion/benchmark/sliding_statistics.dart
15001501
tool/code_completion/code_metrics.dart
15011502
tool/code_completion/completion_at.dart
1503+
tool/code_completion/completion_metrics.dart
15021504
tool/code_completion/completion_metrics_base.dart
15031505
tool/code_completion/completion_metrics_client.dart
15041506
tool/code_completion/corpus.dart
1507+
tool/code_completion/flutter_metrics.dart
15051508
tool/code_completion/implicit_type_declarations.dart
15061509
tool/code_completion/metrics_util.dart
15071510
tool/code_completion/output_utilities.dart
1508-
tool/code_completion/completion_metrics.dart
1509-
tool/code_completion/flutter_metrics.dart
15101511
tool/code_completion/relevance_metrics.dart
15111512
tool/code_completion/relevance_table_generator.dart
15121513
tool/code_completion/visitors.dart

pkg/analysis_server/lib/src/flutter/flutter_outline_computer.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'package:analysis_server/src/protocol_server.dart' as protocol;
77
import 'package:analyzer/dart/analysis/results.dart';
88
import 'package:analyzer/dart/ast/ast.dart';
99
import 'package:analyzer/dart/ast/visitor.dart';
10-
import 'package:analyzer/dart/element/element.dart';
10+
import 'package:analyzer/dart/element/element2.dart';
1111
import 'package:analyzer/dart/element/type.dart';
1212
import 'package:analyzer/src/utilities/extensions/flutter.dart';
1313

@@ -49,7 +49,7 @@ class FlutterOutlineComputer {
4949
/// If the given [argument] for the [parameter] can be represented as a
5050
/// Flutter attribute, add it to the [attributes].
5151
void _addAttribute(List<protocol.FlutterOutlineAttribute> attributes,
52-
Expression argument, ParameterElement? parameter) {
52+
Expression argument, FormalParameterElement? parameter) {
5353
if (parameter == null) {
5454
return;
5555
}
@@ -132,7 +132,7 @@ class FlutterOutlineComputer {
132132
if (type is! InterfaceType || !type.isWidgetType) {
133133
return null;
134134
}
135-
var className = type.element.displayName;
135+
var className = type.element3.displayName;
136136

137137
if (node is InstanceCreationExpression) {
138138
var attributes = <protocol.FlutterOutlineAttribute>[];
@@ -195,7 +195,7 @@ class FlutterOutlineComputer {
195195
if (visitor.outlines.isNotEmpty) {
196196
children.addAll(visitor.outlines);
197197
} else {
198-
var parameter = argument.staticParameterElement;
198+
var parameter = argument.correspondingParameter;
199199
_addAttribute(attributes, argument, parameter);
200200
}
201201
}

0 commit comments

Comments
 (0)