Skip to content

Commit cce2932

Browse files
authored
[record_use] Rename Identifier to Definition (dart-lang#3076)
1 parent c6aca4e commit cce2932

27 files changed

Lines changed: 162 additions & 162 deletions

File tree

‎pkgs/data_assets/lib/src/data_assets/data_asset.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'syntax.g.dart';
1313
/// asset at runtime, the [id] is used. This enables access to the asset
1414
/// irrespective of how and where the application is run.
1515
///
16-
/// An data asset must provide a [DataAsset.file]. The Dart and Flutter SDK will
16+
/// A data asset must provide a [DataAsset.file]. The Dart and Flutter SDK will
1717
/// bundle this code in the final application.
1818
final class DataAsset {
1919
/// The file to be bundled with the Dart or Flutter application.
@@ -32,7 +32,7 @@ final class DataAsset {
3232

3333
/// The identifier for this data asset.
3434
///
35-
/// An [DataAsset] has a string identifier called "asset id". Dart code that
35+
/// A [DataAsset] has a string identifier called "asset id". Dart code that
3636
/// uses an asset references the asset using this asset id.
3737
///
3838
/// An asset identifier consists of two elements, the `package` and `name`,

‎pkgs/hooks/example/link/package_with_assets/hook/link.dart‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ import 'package:data_assets/data_assets.dart';
1111
import 'package:hooks/hooks.dart';
1212
import 'package:record_use/record_use.dart';
1313

14-
const someMethodIdentifier = Identifier(
14+
const someMethodDefinition = Definition(
1515
importUri: 'package:package_with_assets/package_with_assets.dart',
1616
name: 'someMethod',
1717
);
1818

19-
const someOtherMethodIdentifier = Identifier(
19+
const someOtherMethodDefinition = Definition(
2020
importUri: 'package:package_with_assets/package_with_assets.dart',
2121
name: 'someOtherMethod',
2222
);
2323

2424
final assetMapping = {
25-
someMethodIdentifier: 'assets/used_asset.json',
26-
someOtherMethodIdentifier: 'assets/unused_asset.json',
25+
someMethodDefinition: 'assets/used_asset.json',
26+
someOtherMethodDefinition: 'assets/unused_asset.json',
2727
};
2828

2929
void main(List<String> args) async {

‎pkgs/hooks_runner/lib/src/model/target.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ final class Target implements Comparable<Target> {
145145

146146
/// Compares `this` to [other].
147147
///
148-
/// If [other] is also an [Target], consistent with sorting on [toString].
148+
/// If [other] is also a [Target], consistent with sorting on [toString].
149149
@override
150150
int compareTo(Target other) => toString().compareTo(other.toString());
151151

‎pkgs/hooks_runner/test/build_runner/resources_test.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void main() async {
121121
final _pirateAdventureRecordings = Recordings(
122122
metadata: Metadata(version: Version(1, 0, 0), comment: 'Filtering test'),
123123
calls: {
124-
const Identifier(
124+
const Definition(
125125
importUri: 'package:pirate_speak/src/definitions.dart',
126126
name: 'pirateSpeak',
127127
): [
@@ -136,7 +136,7 @@ final _pirateAdventureRecordings = Recordings(
136136
namedArguments: {},
137137
),
138138
],
139-
const Identifier(
139+
const Definition(
140140
importUri: 'package:pirate_technology/src/definitions.dart',
141141
name: 'useCannon',
142142
): [

‎pkgs/hooks_runner/test_data/pirate_speak/hook/link.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ Future<Recordings> _loadRecordings(Uri file) async {
5252
Set<String> _extractUsedPhrases(Recordings recordings) {
5353
final usages = RecordedUsages.fromJson(recordings.toJson());
5454
final usedPhrases = <String>{};
55-
const pirateSpeakId = Identifier(
55+
const pirateSpeakDef = Definition(
5656
importUri: 'package:pirate_speak/src/definitions.dart',
5757
name: 'pirateSpeak',
5858
);
5959

60-
for (final call in usages.constArgumentsFor(pirateSpeakId)) {
60+
for (final call in usages.constArgumentsFor(pirateSpeakDef)) {
6161
if (call.positional.isNotEmpty) {
6262
if (call.positional.first case StringConstant(:final value)) {
6363
usedPhrases.add(value);

‎pkgs/hooks_runner/test_data/pirate_technology/hook/link.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ Future<Recordings> _loadRecordings(Uri file) async {
4949

5050
Set<String> _extractUsedTechnologies(Recordings recordings) {
5151
final usedTechnologies = <String>{};
52-
for (final identifier in recordings.calls.keys) {
53-
if (identifier.importUri ==
52+
for (final definition in recordings.calls.keys) {
53+
if (definition.importUri ==
5454
'package:pirate_technology/src/definitions.dart') {
5555
// Map function name to tech key (simple capitalization)
5656
// e.g. useCannon -> Cannon
57-
final name = identifier.name;
57+
final name = definition.name;
5858
if (name.startsWith('use')) {
5959
usedTechnologies.add(name.substring(3));
6060
}

‎pkgs/record_use/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ import 'dart:convert';
7777
import 'package:hooks/hooks.dart';
7878
import 'package:record_use/record_use_internal.dart';
7979
80-
final methodId = Identifier(
80+
final methodId = Definition(
8181
importUri: 'myfile.dart',
8282
name: 'myMethod',
8383
);
8484
85-
final classId = Identifier(
85+
final classId = Definition(
8686
importUri: 'myfile.dart',
8787
name: 'myClass',
8888
);

‎pkgs/record_use/doc/schema/record_use.schema.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
}
238238
]
239239
},
240-
"Identifier": {
240+
"Definition": {
241241
"type": "object",
242242
"properties": {
243243
"name": {
@@ -395,7 +395,7 @@
395395
}
396396
},
397397
"identifier": {
398-
"$ref": "#/definitions/Identifier"
398+
"$ref": "#/definitions/Definition"
399399
},
400400
"instances": {
401401
"type": "array",

‎pkgs/record_use/doc/use_cases/jnigen.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const dartToJava = {
8888
importUrl: 'package:foo/foo.dart',
8989
name: 'Bar',
9090
methodName: 'baz',
91-
) : JavaMethodIdentifier(
91+
) : JavaMethodDefinition(
9292
qualifiedImport: 'org.foo.foo',
9393
name: 'Bar',
9494
methodName: 'baz',

‎pkgs/record_use/lib/record_use.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export 'src/constant.dart'
1515
NullConstant,
1616
StringConstant,
1717
UnsupportedConstant;
18-
export 'src/identifier.dart' show Identifier;
18+
export 'src/definition.dart' show Definition;
1919
export 'src/metadata.dart' show Metadata;
2020
export 'src/record_use.dart' show RecordedUsages;
2121
export 'src/recorded_usage_from_file.dart' show parseFromFile;

0 commit comments

Comments
 (0)