Skip to content

Commit b1d1bbd

Browse files
stereotype441Commit Queue
authored andcommitted
[analyzer] Make a pubic URI for clients to import TimestampedData.
The `TimestampedData` class is already exposed through the analyzer API as a result of its use in the public `Source` class; this change merely allows clients to refer to it directly without importing from `package:analyzer/src`. Making this change will allow an import of `package:analyzer/src` to be removed from dartdoc. Change-Id: I4d28662854513ba0098ef1f5279cb7cb276e832b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442163 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
1 parent a36f38b commit b1d1bbd

File tree

3 files changed

+27
-19
lines changed

3 files changed

+27
-19
lines changed

pkg/analyzer/api.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5199,6 +5199,11 @@ package:analyzer/source/source_range.dart:
51995199
intersects (method: bool Function(SourceRange?))
52005200
startsIn (method: bool Function(SourceRange))
52015201
toString (method: String Function())
5202+
package:analyzer/source/timestamped_data.dart:
5203+
TimestampedData (class<E> extends Object):
5204+
new (constructor: TimestampedData<E> Function(int, E))
5205+
data (getter: E)
5206+
modificationTime (getter: int)
52025207
package:analyzer/src/dart/analysis/experiments_impl.dart:
52035208
ExperimentalFeature (class extends Object implements Feature):
52045209
new (constructor: ExperimentalFeature Function({List<String> channels, required String documentation, required String enableString, required Version? experimentalReleaseVersion, required int index, required bool isEnabledByDefault, required bool isExpired, required Version? releaseVersion}))
@@ -5227,11 +5232,6 @@ package:analyzer/src/dart/resolver/scope.dart:
52275232
definedNames2 (getter: Map<String, Element>)
52285233
get2 (method: Element? Function(String))
52295234
getPrefixed2 (method: Element? Function(String, String))
5230-
package:analyzer/src/generated/timestamped_data.dart:
5231-
TimestampedData (class<E> extends Object):
5232-
new (constructor: TimestampedData<E> Function(int, E))
5233-
data (getter: E)
5234-
modificationTime (getter: int)
52355235
package:analyzer/src/lint/config.dart:
52365236
RuleConfig (non-public)
52375237
package:analyzer/src/workspace/workspace.dart:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
/// Analysis data for which we have a modification time.
6+
class TimestampedData<E> {
7+
/// The modification time of the source from which the data was created.
8+
final int modificationTime;
9+
10+
/// The data that was created from the source.
11+
final E data;
12+
13+
/// Initialize a newly created holder to associate the given [data] with the
14+
/// given [modificationTime].
15+
TimestampedData(this.modificationTime, this.data);
16+
}

pkg/analyzer/lib/src/generated/timestamped_data.dart

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:_fe_analyzer_shared/src/base/analyzer_public_api.dart';
5+
// This export is needed because package `dartdoc` imports the `TimestampedData`
6+
// class from here.
7+
//
8+
// TODO(paulberry): update dartdoc's import, so that this library can be
9+
// deprecated and eventually removed.
610

7-
/// Analysis data for which we have a modification time.
8-
@AnalyzerPublicApi(message: 'exposed by Source.contents')
9-
class TimestampedData<E> {
10-
/// The modification time of the source from which the data was created.
11-
final int modificationTime;
12-
13-
/// The data that was created from the source.
14-
final E data;
15-
16-
/// Initialize a newly created holder to associate the given [data] with the
17-
/// given [modificationTime].
18-
TimestampedData(this.modificationTime, this.data);
19-
}
11+
export 'package:analyzer/source/timestamped_data.dart' show TimestampedData;

0 commit comments

Comments
 (0)