Skip to content

Commit cf1f2e5

Browse files
scheglovCommit Queue
authored andcommitted
Breaking changes for analyzer version 7.0.0
Change-Id: Id6e329c7665d1dca1920d744dd7d0e9722da768c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311461 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 733701b commit cf1f2e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+153
-3876
lines changed

pkg/analyzer/CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
## 7.0.0 (Not yet released - breaking changes)
2+
* Remove deprecated `DartType.element2`.
3+
* Remove deprecated `DartType.isDynamic`.
4+
* Remove deprecated `DartType.isVoid`.
5+
* Remove deprecated `DartType.resolveToBound`.
6+
* Remove deprecated `IfElement.condition`.
7+
* Remove deprecated `IfStatement.condition`.
8+
* Remove deprecated `AstNode.getProperty` and `AstNode.setProperty`.
9+
* Remove `File.createSource()`, it violates levels of abstraction.
10+
You can get `Source` instances from `AnalysisResult`s.
11+
* Remove deprecated `LibraryElement.toLegacyTypeIfOptOut`.
12+
* Remove deprecated `LibraryElement.toLegacyElementIfOptOut`.
13+
* Remove deprecated `LibraryElement.isNonNullableByDefault`.
14+
* Remove deprecated `File.changes` and `Folder.changes`.
15+
* Remove deprecated `Resource.parent2`.
16+
* Remove deprecated `OnClause`.
17+
* Remove deprecated `ContextBuilder`, use `AnalysisContextCollection`.
18+
* Remove deprecated `ContextLocator`, use `AnalysisContextCollection`.
19+
* Remove deprecated `ClassOrAugmentationDeclaration.`.
20+
* Remove deprecated `MixinOrAugmentationDeclaration.`.
21+
* Remove deprecated members of `AnalysisError`.
22+
* Remove deprecated `TypeSystem.instantiateToBounds2`.
23+
* Remove deprecated `buildSdkSummary2()`.
24+
* Remove deprecated `FileSource.fileReadMode`.
25+
* Remove deprecated members of `ErrorReporter`.
26+
* Remove deprecated `Comment.isBlock`, `isDocumentation`, `isEndOfLine`.
27+
* Remove deprecated `Element.enclosingElement`.
28+
* Remove deprecated `PropertyAccessor.variable`.
29+
* Remove experimental `LibraryOrAugmentationElement`.
30+
* Remove deprecated `LibraryElement` properties.
31+
* Remove deprecated `enabledPluginNames` and `hint` from `AnalysisOptions`.
32+
* Remove deprecated `source_io.dart`.
33+
* Remove deprecated `lint/Spelunker`.
34+
* Remove deprecated `source_resource.dart`.
35+
136
## 6.11.0
237
* Un-deprecated `LibraryElement.exportedLibraries`.
338
* Un-deprecated `LibraryElement.importedLibraries`.

pkg/analyzer/lib/dart/analysis/analysis_options.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:analyzer/dart/analysis/features.dart';
77
import 'package:analyzer/dart/analysis/formatter_options.dart';
88
import 'package:analyzer/source/error_processor.dart';
99
import 'package:analyzer/src/lint/linter.dart';
10-
import 'package:pub_semver/src/version_constraint.dart';
1110

1211
/// A set of analysis options used to control the behavior of an analysis
1312
/// context.
@@ -28,9 +27,6 @@ abstract class AnalysisOptions {
2827
/// legacy plugin, the legacy plugin should be enabled.
2928
List<String> get enabledLegacyPluginNames;
3029

31-
@Deprecated("Use 'enabledLegacyPluginNames' instead")
32-
List<String> get enabledPluginNames;
33-
3430
/// Return a list of error processors that are to be used when reporting
3531
/// errors in some analysis context.
3632
List<ErrorProcessor> get errorProcessors;
@@ -42,23 +38,13 @@ abstract class AnalysisOptions {
4238
/// Return the options used to control the formatter.
4339
FormatterOptions get formatterOptions;
4440

45-
/// Return `true` if analysis is to generate hint results (e.g. best practices
46-
/// and analysis based on certain annotations).
47-
@Deprecated("Use 'warning' instead")
48-
bool get hint;
49-
5041
/// Whether analysis is to generate lint warnings.
5142
bool get lint;
5243

5344
/// A list of the lint rules that are to be run in an analysis context if
5445
/// [lint] is `true`.
5546
List<LintRule> get lintRules;
5647

57-
/// The version range for the SDK specified in `pubspec.yaml`, or `null` if
58-
/// there is no `pubspec.yaml` or if it does not contain an SDK range.
59-
@Deprecated('Use `PubWorkspacePackage.sdkVersionConstraint` instead')
60-
VersionConstraint? get sdkVersionConstraint;
61-
6248
/// Whether implicit casts should be reported as potential problems.
6349
bool get strictCasts;
6450

pkg/analyzer/lib/dart/analysis/context_builder.dart

Lines changed: 0 additions & 45 deletions
This file was deleted.

pkg/analyzer/lib/dart/analysis/context_locator.dart

Lines changed: 0 additions & 38 deletions
This file was deleted.

pkg/analyzer/lib/dart/ast/ast.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,6 @@ export 'package:analyzer/src/dart/ast/ast.dart'
183183
NullLiteral,
184184
NullShortableExpression,
185185
ObjectPattern,
186-
// ignore:deprecated_member_use_from_same_package
187-
OnClause,
188186
ParenthesizedExpression,
189187
ParenthesizedPattern,
190188
PartDirective,
@@ -255,9 +253,3 @@ export 'package:analyzer/src/dart/ast/ast.dart'
255253
WildcardPattern,
256254
WithClause,
257255
YieldStatement;
258-
259-
@Deprecated('This class was removed, use ClassDeclaration instead')
260-
typedef ClassOrAugmentationDeclaration = ClassDeclaration;
261-
262-
@Deprecated('This class was removed, use MixinDeclaration instead')
263-
typedef MixinOrAugmentationDeclaration = MixinDeclaration;

pkg/analyzer/lib/dart/ast/visitor.dart

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,7 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
516516

517517
@override
518518
R? visitMixinOnClause(MixinOnClause node) {
519-
// ignore:deprecated_member_use_from_same_package
520-
return visitOnClause(node);
519+
return visitNode(node);
521520
}
522521

523522
R? visitNamedCompilationUnitMember(NamedCompilationUnitMember node) =>
@@ -563,10 +562,6 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
563562
@override
564563
R? visitObjectPattern(ObjectPattern node) => visitDartPattern(node);
565564

566-
@Deprecated('Use visitMixinOnClause() instead')
567-
@override
568-
R? visitOnClause(OnClause node) => visitNode(node);
569-
570565
@override
571566
R? visitParenthesizedExpression(ParenthesizedExpression node) =>
572567
visitExpression(node);
@@ -1420,8 +1415,8 @@ class RecursiveAstVisitor<R> implements AstVisitor<R> {
14201415

14211416
@override
14221417
R? visitMixinOnClause(MixinOnClause node) {
1423-
// ignore:deprecated_member_use_from_same_package
1424-
return visitOnClause(node);
1418+
node.visitChildren(this);
1419+
return null;
14251420
}
14261421

14271422
@override
@@ -1478,13 +1473,6 @@ class RecursiveAstVisitor<R> implements AstVisitor<R> {
14781473
return null;
14791474
}
14801475

1481-
@Deprecated('Use visitMixinOnClause() instead')
1482-
@override
1483-
R? visitOnClause(OnClause node) {
1484-
node.visitChildren(this);
1485-
return null;
1486-
}
1487-
14881476
@override
14891477
R? visitParenthesizedExpression(ParenthesizedExpression node) {
14901478
node.visitChildren(this);
@@ -2170,10 +2158,7 @@ class SimpleAstVisitor<R> implements AstVisitor<R> {
21702158
R? visitMixinDeclaration(MixinDeclaration node) => null;
21712159

21722160
@override
2173-
R? visitMixinOnClause(MixinOnClause node) {
2174-
// ignore:deprecated_member_use_from_same_package
2175-
return visitOnClause(node);
2176-
}
2161+
R? visitMixinOnClause(MixinOnClause node) => null;
21772162

21782163
@override
21792164
R? visitNamedExpression(NamedExpression node) => null;
@@ -2202,10 +2187,6 @@ class SimpleAstVisitor<R> implements AstVisitor<R> {
22022187
@override
22032188
R? visitObjectPattern(ObjectPattern node) => null;
22042189

2205-
@Deprecated('Use visitMixinOnClause() instead')
2206-
@override
2207-
R? visitOnClause(OnClause node) => null;
2208-
22092190
@override
22102191
R? visitParenthesizedExpression(ParenthesizedExpression node) => null;
22112192

@@ -2725,10 +2706,7 @@ class ThrowingAstVisitor<R> implements AstVisitor<R> {
27252706
R? visitMixinDeclaration(MixinDeclaration node) => _throw(node);
27262707

27272708
@override
2728-
R? visitMixinOnClause(MixinOnClause node) {
2729-
// ignore:deprecated_member_use_from_same_package
2730-
return visitOnClause(node);
2731-
}
2709+
R? visitMixinOnClause(MixinOnClause node) => _throw(node);
27322710

27332711
@override
27342712
R? visitNamedExpression(NamedExpression node) => _throw(node);
@@ -2757,10 +2735,6 @@ class ThrowingAstVisitor<R> implements AstVisitor<R> {
27572735
@override
27582736
R? visitObjectPattern(ObjectPattern node) => _throw(node);
27592737

2760-
@Deprecated('Use visitMixinOnClause() instead')
2761-
@override
2762-
R? visitOnClause(OnClause node) => _throw(node);
2763-
27642738
@override
27652739
R? visitParenthesizedExpression(ParenthesizedExpression node) => _throw(node);
27662740

@@ -3798,8 +3772,10 @@ class TimedAstVisitor<T> implements AstVisitor<T> {
37983772

37993773
@override
38003774
T? visitMixinOnClause(MixinOnClause node) {
3801-
// ignore:deprecated_member_use_from_same_package
3802-
return visitOnClause(node);
3775+
stopwatch.start();
3776+
T? result = _baseVisitor.visitMixinOnClause(node);
3777+
stopwatch.stop();
3778+
return result;
38033779
}
38043780

38053781
@override
@@ -3874,15 +3850,6 @@ class TimedAstVisitor<T> implements AstVisitor<T> {
38743850
return result;
38753851
}
38763852

3877-
@Deprecated('Use visitMixinOnClause() instead')
3878-
@override
3879-
T? visitOnClause(OnClause node) {
3880-
stopwatch.start();
3881-
T? result = _baseVisitor.visitOnClause(node);
3882-
stopwatch.stop();
3883-
return result;
3884-
}
3885-
38863853
@override
38873854
T? visitParenthesizedExpression(ParenthesizedExpression node) {
38883855
stopwatch.start();
@@ -4708,10 +4675,7 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
47084675
R? visitMixinDeclaration(MixinDeclaration node) => visitNode(node);
47094676

47104677
@override
4711-
R? visitMixinOnClause(MixinOnClause node) {
4712-
// ignore:deprecated_member_use_from_same_package
4713-
return visitOnClause(node);
4714-
}
4678+
R? visitMixinOnClause(MixinOnClause node) => visitNode(node);
47154679

47164680
@override
47174681
R? visitNamedExpression(NamedExpression node) => visitNode(node);
@@ -4745,10 +4709,6 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
47454709
@override
47464710
R? visitObjectPattern(ObjectPattern node) => visitNode(node);
47474711

4748-
@Deprecated('Use visitMixinOnClause() instead')
4749-
@override
4750-
R? visitOnClause(OnClause node) => visitNode(node);
4751-
47524712
@override
47534713
R? visitParenthesizedExpression(ParenthesizedExpression node) =>
47544714
visitNode(node);

0 commit comments

Comments
 (0)