Skip to content

Commit

Permalink
Remove some deprecated fields from dart_services models (#2948)
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed May 6, 2024
1 parent 7e660d4 commit 9393c5c
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 73 deletions.
2 changes: 0 additions & 2 deletions pkgs/dart_services/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ analyzer:
errors:
lines_longer_than_80_chars: ignore
unreachable_from_main: ignore
# Remove this once we remove the AnalysisIssue.sourceName field.
deprecated_member_use_from_same_package: ignore

linter:
rules:
Expand Down
9 changes: 1 addition & 8 deletions pkgs/dart_services/lib/src/analysis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ class AnalysisServerWrapper {
),
);
}).toList(),
sourceName: path.basename(error.location.file),
);

return issue;
Expand Down Expand Up @@ -359,13 +358,7 @@ class AnalysisServerWrapper {
}
}

return api.AnalysisResponse(
issues: [
...importIssues,
...issues,
],
packageImports: [],
);
return api.AnalysisResponse(issues: [...importIssues, ...issues]);
}

/// Cleanly shutdown the Analysis Server.
Expand Down
7 changes: 0 additions & 7 deletions 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.

38 changes: 17 additions & 21 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: 0 additions & 2 deletions pkgs/dart_services/test/server_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ void main() {
}
'''));
expect(result.issues, isEmpty);
expect(result.packageImports, isEmpty);
});

test('analyze flutter', () async {
Expand All @@ -76,7 +75,6 @@ class MyApp extends StatelessWidget {

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

test('analyze errors', () async {
Expand Down
3 changes: 0 additions & 3 deletions pkgs/dartpad_shared/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ analyzer:
strict-casts: true
strict-inference: true
strict-raw-types: true
errors:
# Remove this once we remove the AnalysisIssue.sourceName field.
deprecated_member_use_from_same_package: ignore

linter:
rules:
Expand Down
7 changes: 0 additions & 7 deletions pkgs/dartpad_shared/lib/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ class SourceRequest {
class AnalysisResponse {
final List<AnalysisIssue> issues;

@Deprecated('This field was unused and will be removed in a future update.')
final List<String>? packageImports;

AnalysisResponse({
required this.issues,
this.packageImports,
});

factory AnalysisResponse.fromJson(Map<String, dynamic> json) =>
Expand All @@ -49,8 +45,6 @@ class AnalysisIssue {
final String? correction;
final String? url;
final List<DiagnosticMessage>? contextMessages;
@Deprecated('Remove this once no longer referenced')
final String sourceName;

AnalysisIssue({
required this.kind,
Expand All @@ -60,7 +54,6 @@ class AnalysisIssue {
this.correction,
this.url,
this.contextMessages,
this.sourceName = 'main.dart',
});

factory AnalysisIssue.fromJson(Map<String, dynamic> json) =>
Expand Down
38 changes: 17 additions & 21 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.

4 changes: 2 additions & 2 deletions pkgs/dartpad_shared/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ environment:

dependencies:
http: ^1.1.0
json_annotation: ^4.8.1
json_annotation: ^4.9.0

dev_dependencies:
build_runner: ^2.4.5
dart_flutter_team_lints: ^2.1.1
json_serializable: ^6.7.0
json_serializable: ^6.8.0

0 comments on commit 9393c5c

Please sign in to comment.