Skip to content

Commit a3bd2ad

Browse files
stereotype441Commit Queue
authored andcommitted
[analyzer] Remove @experimental annotations from API.
Removes all the `@experimental` annotations from the analyzer API. Since these annotations are not yet enforced through warnings, in effect everything the analyzer public API has to be supported until the next breaking change release, whether it's marked `@experimental` or not. Removing the `@experimental` annotations reflects this reality. In follow-up CLs, I will introduce analyzer functionality that causes warnings to be issued if an API method marked `@experimental` is used (or overridden) from outside of its declaring package. Once that has landed, we'll be able to safely start using `@experimental` to tag parts of the analyzer public API for which we don't guarantee long-term support. Change-Id: I6a6a69649843afa6057b249156dec701e1aa26dd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/449926 Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent 6be105b commit a3bd2ad

File tree

16 files changed

+172
-376
lines changed

16 files changed

+172
-376
lines changed

pkg/analyzer/api.txt

Lines changed: 172 additions & 172 deletions
Large diffs are not rendered by default.

pkg/analyzer/lib/dart/analysis/analysis_context.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'package:analyzer/dart/analysis/context_root.dart';
66
import 'package:analyzer/dart/analysis/session.dart';
77
import 'package:analyzer/file_system/file_system.dart';
88
import 'package:analyzer/src/generated/engine.dart';
9-
import 'package:meta/meta.dart';
109

1110
/// A representation of a body of code and the context in which the code is to
1211
/// be analyzed.
@@ -61,6 +60,5 @@ abstract class AnalysisContext {
6160
///
6261
/// NOTE: this API is experimental and subject to change in a future
6362
/// release (see https://github.com/dart-lang/sdk/issues/53876 for context).
64-
@experimental
6563
AnalysisOptions getAnalysisOptionsForFile(File file);
6664
}

pkg/analyzer/lib/dart/analysis/results.dart

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import 'package:analyzer/dart/element/type_system.dart';
1111
import 'package:analyzer/diagnostic/diagnostic.dart';
1212
import 'package:analyzer/file_system/file_system.dart';
1313
import 'package:analyzer/source/line_info.dart';
14-
import 'package:meta/meta.dart';
1514

1615
@Deprecated('Use AnalysisResultWithDiagnostics instead')
1716
typedef AnalysisResultWithErrors = AnalysisResultWithDiagnostics;
@@ -169,12 +168,10 @@ abstract class InvalidResult {}
169168
/// Clients may not extend, implement or mix-in this class.
170169
abstract class LibraryElementResult implements SomeLibraryElementResult {
171170
/// The element representing the library.
172-
@experimental
173171
LibraryElement get element;
174172

175173
/// The element representing the library.
176174
@Deprecated('Use element instead')
177-
@experimental
178175
LibraryElement get element2;
179176
}
180177

@@ -246,15 +243,13 @@ abstract class ParsedLibraryResult
246243
///
247244
/// Throws [ArgumentError] if the [fragment] is not defined in this library.
248245
@Deprecated('Use getFragmentDeclaration() instead')
249-
@experimental
250246
ElementDeclarationResult? getElementDeclaration2(Fragment fragment);
251247

252248
/// Returns the declaration of the [fragment].
253249
///
254250
/// Returns `null` if the [fragment] is synthetic.
255251
///
256252
/// Throws [ArgumentError] if the [fragment] is not defined in this library.
257-
@experimental
258253
FragmentDeclarationResult? getFragmentDeclaration(Fragment fragment);
259254
}
260255

@@ -295,12 +290,10 @@ abstract class ParseStringResult {
295290
abstract class ResolvedLibraryResult
296291
implements ParsedLibraryResult, SomeResolvedLibraryResult {
297292
/// The element representing this library.
298-
@experimental
299293
LibraryElement get element;
300294

301295
/// The element representing this library.
302296
@Deprecated('Use element instead')
303-
@experimental
304297
LibraryElement get element2;
305298

306299
/// The type provider used when resolving the library.
@@ -325,16 +318,13 @@ abstract class ResolvedUnitResult
325318
bool get exists;
326319

327320
/// The element representing the library containing the compilation [unit].
328-
@experimental
329321
LibraryElement get libraryElement;
330322

331323
/// The element representing the library containing the compilation [unit].
332324
@Deprecated('Use libraryElement instead')
333-
@experimental
334325
LibraryElement get libraryElement2;
335326

336327
/// The fragment corresponding to the [unit].
337-
@experimental
338328
LibraryFragment get libraryFragment;
339329

340330
/// The type provider used when resolving the compilation [unit].
@@ -419,7 +409,6 @@ abstract class SomeUnitElementResult {}
419409
// TODO(scheglov): Stop implementing [FileResult].
420410
abstract class UnitElementResult implements SomeUnitElementResult, FileResult {
421411
/// The fragment representing the content of the file.
422-
@experimental
423412
LibraryFragment get fragment;
424413
}
425414

pkg/analyzer/lib/dart/analysis/session.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:analyzer/dart/analysis/uri_converter.dart';
99
import 'package:analyzer/dart/element/element.dart';
1010
import 'package:analyzer/exception/exception.dart';
1111
import 'package:analyzer/file_system/file_system.dart';
12-
import 'package:meta/meta.dart';
1312

1413
/// A consistent view of the results of analyzing one or more files.
1514
///
@@ -52,13 +51,11 @@ abstract class AnalysisSession {
5251

5352
/// Return information about the results of parsing units of the library file
5453
/// with the given library [element].
55-
@experimental
5654
SomeParsedLibraryResult getParsedLibraryByElement(LibraryElement element);
5755

5856
/// Return information about the results of parsing units of the library file
5957
/// with the given library [element].
6058
@Deprecated('Use getParsedLibraryByElement instead')
61-
@experimental
6259
SomeParsedLibraryResult getParsedLibraryByElement2(LibraryElement element);
6360

6461
/// Return information about the results of parsing the file with the given
@@ -74,7 +71,6 @@ abstract class AnalysisSession {
7471
/// resolving all of the files in the library with the library [element].
7572
///
7673
/// Throw [ArgumentError] if the [element] was not produced by this session.
77-
@experimental
7874
Future<SomeResolvedLibraryResult> getResolvedLibraryByElement(
7975
LibraryElement element,
8076
);
@@ -84,7 +80,6 @@ abstract class AnalysisSession {
8480
///
8581
/// Throw [ArgumentError] if the [element] was not produced by this session.
8682
@Deprecated('Use getResolvedLibraryByElement instead')
87-
@experimental
8883
Future<SomeResolvedLibraryResult> getResolvedLibraryByElement2(
8984
LibraryElement element,
9085
);

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
library;
77

88
import 'package:analyzer/dart/ast/ast.dart';
9-
import 'package:meta/meta.dart';
109

1110
/// A block doc directive, denoted by an opening tag, and a closing tag.
1211
///
1312
/// The text in between the two tags is not explicitly called out. It can be
1413
/// read from the original compilation unit, between the offsets of the opening
1514
/// and closing tags.
16-
@experimental
1715
final class BlockDocDirective implements DocDirective {
1816
final DocDirectiveTag openingTag;
1917
final DocDirectiveTag? closingTag;
@@ -25,7 +23,6 @@ final class BlockDocDirective implements DocDirective {
2523
}
2624

2725
/// The type of Markdown code block in a documentation comment.
28-
@experimental
2926
enum CodeBlockType {
3027
/// Fenced code blocks begin with a code fence, preceded by up to three spaces
3128
/// of indentation.
@@ -43,13 +40,11 @@ enum CodeBlockType {
4340
/// as a [SimpleDocDirective], represented by a single [DocDirectiveTag], or a
4441
/// [BlockDocDirective], represented by an opening [DocDirectiveTag] and a
4542
/// closing one (in well-formed text).
46-
@experimental
4743
sealed class DocDirective {
4844
DocDirectiveType get type;
4945
}
5046

5147
/// An argument in a doc directive. See [DocDirective] for their syntax.
52-
@experimental
5348
sealed class DocDirectiveArgument {
5449
/// The offset of the start of the argument, from the beginning of the
5550
/// compilation unit.
@@ -70,7 +65,6 @@ sealed class DocDirectiveArgument {
7065
}
7166

7267
/// A named argument in a doc directive. See [DocDirective] for their syntax.
73-
@experimental
7468
final class DocDirectiveNamedArgument extends DocDirectiveArgument {
7569
/// The name of the argument.
7670
final String name;
@@ -84,7 +78,6 @@ final class DocDirectiveNamedArgument extends DocDirectiveArgument {
8478
}
8579

8680
/// A parameter in a doc directive, with it's expected format, if it has one.
87-
@experimental
8881
final class DocDirectiveParameter {
8982
final String name;
9083
final DocDirectiveParameterFormat expectedFormat;
@@ -94,7 +87,6 @@ final class DocDirectiveParameter {
9487

9588
/// The expected format of a doc directive parameter, which indicates some
9689
/// minimal validation that can produce diagnostics.
97-
@experimental
9890
enum DocDirectiveParameterFormat {
9991
/// A format indicating that arguments are not validated.
10092
any('any'),
@@ -118,7 +110,6 @@ enum DocDirectiveParameterFormat {
118110

119111
/// A positional argument in a doc directive. See [DocDirective] for their
120112
/// syntax.
121-
@experimental
122113
final class DocDirectivePositionalArgument extends DocDirectiveArgument {
123114
DocDirectivePositionalArgument({
124115
required super.offset,
@@ -137,7 +128,6 @@ final class DocDirectivePositionalArgument extends DocDirectiveArgument {
137128
/// whitespace. There are two types of arguments: positional and named. Named
138129
/// arguments are written as `NAME=VALUE`, without any internal whitespace.
139130
/// Named arguments can be optional.
140-
@experimental
141131
final class DocDirectiveTag {
142132
/// The offset of the starting text; for example: '@animation'.
143133
final int offset;
@@ -161,7 +151,6 @@ final class DocDirectiveTag {
161151
});
162152
}
163153

164-
@experimental
165154
enum DocDirectiveType {
166155
/// A [DocDirective] declaring an embedded video with HTML video controls.
167156
///
@@ -391,7 +380,6 @@ enum DocDirectiveType {
391380
/// Documentation imports are declared with `@docImport` at the start of a line
392381
/// of a documentation comment, followed by regular import elements (URI,
393382
/// optional prefix, optional combinators), ending with a semicolon.
394-
@experimental
395383
final class DocImport {
396384
/// The offset of the starting text, '@docImport'.
397385
int offset;
@@ -402,7 +390,6 @@ final class DocImport {
402390
}
403391

404392
/// A Markdown fenced code block found in a documentation comment.
405-
@experimental
406393
final class MdCodeBlock {
407394
/// The 'info string'.
408395
///
@@ -434,7 +421,6 @@ final class MdCodeBlock {
434421
}
435422

436423
/// A Markdown code block line found in a documentation comment.
437-
@experimental
438424
final class MdCodeBlockLine {
439425
/// The offset of the start of the code block, from the beginning of the
440426
/// compilation unit.
@@ -446,7 +432,6 @@ final class MdCodeBlockLine {
446432
MdCodeBlockLine({required this.offset, required this.length});
447433
}
448434

449-
@experimental
450435
final class SimpleDocDirective implements DocDirective {
451436
final DocDirectiveTag tag;
452437

pkg/analyzer/lib/dart/constant/value.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ library;
1414

1515
import 'package:analyzer/dart/element/element.dart';
1616
import 'package:analyzer/dart/element/type.dart';
17-
import 'package:meta/meta.dart';
1817

1918
/// Information about a const constructor invocation.
2019
abstract class ConstructorInvocation {
@@ -125,7 +124,6 @@ abstract class DartObject {
125124
/// * this object is not of a function type,
126125
/// * the value of the object being represented is not known, or
127126
/// * the value of the object being represented is `null`.
128-
@experimental
129127
ExecutableElement? toFunctionValue();
130128

131129
/// Return an element corresponding to the value of the object being
@@ -135,7 +133,6 @@ abstract class DartObject {
135133
/// * the value of the object being represented is not known, or
136134
/// * the value of the object being represented is `null`.
137135
@Deprecated('Use toFunctionValue instead')
138-
@experimental
139136
ExecutableElement? toFunctionValue2();
140137

141138
/// Return an integer corresponding to the value of the object being

pkg/analyzer/lib/dart/element/element.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ import 'package:analyzer/source/line_info.dart';
5959
import 'package:analyzer/source/source.dart';
6060
import 'package:analyzer/src/dart/element/inheritance_manager3.dart' show Name;
6161
import 'package:analyzer/src/dart/resolver/scope.dart';
62-
import 'package:meta/meta.dart';
6362
import 'package:pub_semver/pub_semver.dart';
6463

6564
export 'package:analyzer/src/dart/element/inheritance_manager3.dart' show Name;
@@ -552,7 +551,6 @@ abstract class DirectiveUriWithSource extends DirectiveUriWithRelativeUri {
552551
/// Clients may not extend, implement or mix-in this class.
553552
abstract class DirectiveUriWithUnit extends DirectiveUriWithSource {
554553
/// The library fragment referenced by the [source].
555-
@experimental
556554
LibraryFragment get libraryFragment;
557555
}
558556

0 commit comments

Comments
 (0)