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

Deprecate unused packageImports field in analysis response #2756

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
4 changes: 0 additions & 4 deletions pkgs/dart_services/lib/src/analysis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,6 @@ class AnalysisServerWrapper {
...importIssues,
...issues,
],
packageImports: imports
parlough marked this conversation as resolved.
Show resolved Hide resolved
.where((import) => import.packageImport)
.map((import) => import.packageName)
.toList(),
);
}

Expand Down
4 changes: 3 additions & 1 deletion pkgs/dart_services/lib/src/shared/model.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions pkgs/dart_services/lib/src/shared/model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkgs/dart_services/test/server_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class MyApp extends StatelessWidget {

expect(result, isNotNull);
expect(result.issues, isEmpty);
expect(result.packageImports, contains('flutter'));
expect(result.packageImports, isEmpty);
});

test('analyze errors', () async {
Expand Down
4 changes: 3 additions & 1 deletion pkgs/dartpad_shared/lib/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ class SourceRequest {
@JsonSerializable()
class AnalysisResponse {
final List<AnalysisIssue> issues;

@Deprecated('This field was unused and will be removed in a future update.')
final List<String> packageImports;
parlough marked this conversation as resolved.
Show resolved Hide resolved

AnalysisResponse({
required this.issues,
required this.packageImports,
this.packageImports = const [],
});

factory AnalysisResponse.fromJson(Map<String, dynamic> json) =>
Expand Down
7 changes: 4 additions & 3 deletions pkgs/dartpad_shared/lib/model.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions pkgs/sketch_pad/lib/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class AppModel {
final ValueNotifier<bool> appReady = ValueNotifier(false);

final ValueNotifier<List<AnalysisIssue>> analysisIssues = ValueNotifier([]);
final ValueNotifier<List<String>> packageImports = ValueNotifier([]);

final ValueNotifier<String> title = ValueNotifier('');

Expand Down Expand Up @@ -318,7 +317,6 @@ class AppServices {
SourceRequest(source: appModel.sourceCodeController.text),
);
appModel.analysisIssues.value = results.issues;
appModel.packageImports.value = results.packageImports;
} catch (error) {
appModel.analysisIssues.value = [
AnalysisIssue(
Expand All @@ -327,7 +325,6 @@ class AppServices {
location: Location(line: 0, column: 0),
),
];
appModel.packageImports.value = [];
}
}

Expand Down
Loading