From de28cc3a7f0dc8ceb31b4294db89c1a98aa5ff7f Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Fri, 29 May 2026 11:15:46 -0700 Subject: [PATCH] Fix some code generated files to point to the correct generation script. These files had comments indicating that running `pkg/analysis_server/tool/spec/generate_files` would regenerate them, but that was not the case. Change-Id: I6ceb6352edf6eab5e746276a0a2f33b16a6a6964 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507521 Reviewed-by: Brian Wilkerson --- .../lib/src/protocol/protocol_common.dart | 2 +- pkg/analyzer_plugin/lib/protocol/protocol_common.dart | 2 +- .../lib/protocol/protocol_constants.dart | 2 +- .../lib/protocol/protocol_generated.dart | 2 +- .../integration/support/integration_test_methods.dart | 2 +- .../test/integration/support/protocol_matchers.dart | 2 +- .../tool/spec/codegen_dart_protocol.dart | 3 +++ .../tool/spec/codegen_inttest_methods.dart | 3 +++ pkg/analyzer_plugin/tool/spec/codegen_matchers.dart | 3 +++ .../tool/spec/codegen_protocol_constants.dart | 3 +++ pkg/analyzer_utilities/lib/tools.dart | 10 +++++++--- 11 files changed, 25 insertions(+), 9 deletions(-) diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart index 9659fbf15a4..4ccb90cfd5a 100644 --- a/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart +++ b/pkg/analysis_server_client/lib/src/protocol/protocol_common.dart @@ -4,7 +4,7 @@ // // This file has been automatically generated. Please do not edit it manually. // To regenerate the file, use the script -// "pkg/analysis_server/tool/spec/generate_files". +// "pkg/analyzer_plugin/tool/spec/generate_all.dart". // ignore_for_file: unnecessary_ignore, duplicate_ignore // ignore_for_file: unnecessary_type_name_in_constructor diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart index 90abd7eb996..80cf10fed93 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart @@ -4,7 +4,7 @@ // // This file has been automatically generated. Please do not edit it manually. // To regenerate the file, use the script -// "pkg/analysis_server/tool/spec/generate_files". +// "pkg/analyzer_plugin/tool/spec/generate_all.dart". // ignore_for_file: unnecessary_ignore, duplicate_ignore // ignore_for_file: unnecessary_type_name_in_constructor diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart b/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart index 1c2524b008c..4d2d73c4abd 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol_constants.dart @@ -4,7 +4,7 @@ // // This file has been automatically generated. Please do not edit it manually. // To regenerate the file, use the script -// "pkg/analysis_server/tool/spec/generate_files". +// "pkg/analyzer_plugin/tool/spec/generate_all.dart". // ignore_for_file: unnecessary_ignore, duplicate_ignore // ignore_for_file: unnecessary_type_name_in_constructor diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart b/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart index 0f5c03f69bc..39851891430 100644 --- a/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart +++ b/pkg/analyzer_plugin/lib/protocol/protocol_generated.dart @@ -4,7 +4,7 @@ // // This file has been automatically generated. Please do not edit it manually. // To regenerate the file, use the script -// "pkg/analysis_server/tool/spec/generate_files". +// "pkg/analyzer_plugin/tool/spec/generate_all.dart". // ignore_for_file: unnecessary_ignore, duplicate_ignore // ignore_for_file: unnecessary_type_name_in_constructor diff --git a/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart b/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart index 45871e34775..0411646c58e 100644 --- a/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart +++ b/pkg/analyzer_plugin/test/integration/support/integration_test_methods.dart @@ -4,7 +4,7 @@ // // This file has been automatically generated. Please do not edit it manually. // To regenerate the file, use the script -// "pkg/analysis_server/tool/spec/generate_files". +// "pkg/analyzer_plugin/tool/spec/generate_all.dart". // ignore_for_file: unnecessary_ignore, duplicate_ignore // ignore_for_file: unnecessary_type_name_in_constructor diff --git a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart index 739f5fb2f73..0b7817bc655 100644 --- a/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart +++ b/pkg/analyzer_plugin/test/integration/support/protocol_matchers.dart @@ -4,7 +4,7 @@ // // This file has been automatically generated. Please do not edit it manually. // To regenerate the file, use the script -// "pkg/analysis_server/tool/spec/generate_files". +// "pkg/analyzer_plugin/tool/spec/generate_all.dart". // ignore_for_file: unnecessary_ignore, duplicate_ignore // ignore_for_file: unnecessary_type_name_in_constructor diff --git a/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart b/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart index fe7518402c1..22d278b8226 100644 --- a/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart +++ b/pkg/analyzer_plugin/tool/spec/codegen_dart_protocol.dart @@ -104,6 +104,9 @@ class CodegenProtocolVisitor extends DartCodegenVisitor with CodeGenerator { codeGeneratorSettings.languageName = 'dart'; } + @override + String get regenScript => 'pkg/analyzer_plugin/tool/spec/generate_all.dart'; + /// Compute the code necessary to compare two objects for equality. String compareEqualsCode(TypeDecl type, String thisVar, String otherVar) { var resolvedType = resolveTypeReferenceChain(type); diff --git a/pkg/analyzer_plugin/tool/spec/codegen_inttest_methods.dart b/pkg/analyzer_plugin/tool/spec/codegen_inttest_methods.dart index 0c472d3f843..89047040ced 100644 --- a/pkg/analyzer_plugin/tool/spec/codegen_inttest_methods.dart +++ b/pkg/analyzer_plugin/tool/spec/codegen_inttest_methods.dart @@ -49,6 +49,9 @@ class CodegenInttestMethodsVisitor extends DartCodegenVisitor codeGeneratorSettings.languageName = 'dart'; } + @override + String get regenScript => 'pkg/analyzer_plugin/tool/spec/generate_all.dart'; + /// Generate a function argument for the given parameter field. String formatArgument(TypeObjectField field) => '${fieldDartType(field)} ${field.name}'; diff --git a/pkg/analyzer_plugin/tool/spec/codegen_matchers.dart b/pkg/analyzer_plugin/tool/spec/codegen_matchers.dart index 70a63c994d8..1a31d828c79 100644 --- a/pkg/analyzer_plugin/tool/spec/codegen_matchers.dart +++ b/pkg/analyzer_plugin/tool/spec/codegen_matchers.dart @@ -36,6 +36,9 @@ class CodegenMatchersVisitor extends HierarchicalApiVisitor with CodeGenerator { codeGeneratorSettings.languageName = 'dart'; } + @override + String get regenScript => 'pkg/analyzer_plugin/tool/spec/generate_all.dart'; + /// Create a matcher for the part of the API called [name], optionally /// clarified by [nameSuffix]. The matcher should verify that its input /// matches the given [type]. diff --git a/pkg/analyzer_plugin/tool/spec/codegen_protocol_constants.dart b/pkg/analyzer_plugin/tool/spec/codegen_protocol_constants.dart index fce39d51fb9..03601908c2a 100644 --- a/pkg/analyzer_plugin/tool/spec/codegen_protocol_constants.dart +++ b/pkg/analyzer_plugin/tool/spec/codegen_protocol_constants.dart @@ -27,6 +27,9 @@ class _CodegenVisitor extends DartCodegenVisitor with CodeGenerator { codeGeneratorSettings.languageName = 'dart'; } + @override + String get regenScript => 'pkg/analyzer_plugin/tool/spec/generate_all.dart'; + /// Generate the given [constant]. void generateConstant(_Constant constant) { write('const String '); diff --git a/pkg/analyzer_utilities/lib/tools.dart b/pkg/analyzer_utilities/lib/tools.dart index 0391188eb1b..09c69c96681 100644 --- a/pkg/analyzer_utilities/lib/tools.dart +++ b/pkg/analyzer_utilities/lib/tools.dart @@ -59,6 +59,10 @@ mixin CodeGenerator { /// Measure the width of the current indentation level. int get indentWidth => _state.nextIndent.length; + /// Name of the script that should be included in the header to instruct + /// developers how to re-run code generation. + String get regenScript => 'pkg/analysis_server/tool/spec/generate_files'; + /// Execute [callback], collecting any code that is output using [write] /// or [writeln], and return the result as a string. String collectCode( @@ -169,7 +173,7 @@ mixin CodeGenerator { * BSD-style license that can be found in the LICENSE file. * * This file has been automatically generated. Please do not edit it manually. - * To regenerate the file, use the script "pkg/analysis_server/tool/spec/generate_files". + * To regenerate the file, use the script "$regenScript". */'''; } else if (codeGeneratorSettings.languageName == 'python') { header = @@ -180,7 +184,7 @@ mixin CodeGenerator { # # This file has been automatically generated. Please do not edit it manually. # To regenerate the file, use the script -# "pkg/analysis_server/tool/spec/generate_files". +# "$regenScript". '''; } else { header = @@ -191,7 +195,7 @@ mixin CodeGenerator { // // This file has been automatically generated. Please do not edit it manually. // To regenerate the file, use the script -// "pkg/analysis_server/tool/spec/generate_files". +// "$regenScript". '''; // During the transition period to Dart language version 3.13, some // generated files will be using language version 3.13, and will have the