diff --git a/pkg/analyzer/tool/messages/error_code_info.dart b/pkg/analyzer/tool/messages/error_code_info.dart index e9375bb8864..fd901713426 100644 --- a/pkg/analyzer/tool/messages/error_code_info.dart +++ b/pkg/analyzer/tool/messages/error_code_info.dart @@ -115,20 +115,6 @@ const hintCodesFile = GeneratedErrorCodeFile( parentLibrary: 'package:analyzer/src/dart/error/hint_codes.dart', ); -/// If `true`, the new literate API should be generated. -/// -/// This flag exists as a temporary measure, so that the literate API generation -/// logic can be introduced in steps: -/// - First, the logic to generate templates is introduced, but disabled; it can -/// be easily verified that this change is safe because it doesn't change the -/// generated code. -/// - Then, this constant is turned on, causing templates to be generated; -/// although this causes a lot of generated code to change, it can be verified -/// that this change is safe by inspecting the code that refers to this -/// constant. -/// - Then, this constant is inlined. -const literateApiEnabled = true; - const manifestWarningCodeFile = GeneratedErrorCodeFile( path: 'analyzer/lib/src/manifest/manifest_warning_code.g.dart', parentLibrary: 'package:analyzer/src/manifest/manifest_warning_code.dart', @@ -744,7 +730,7 @@ abstract class ErrorCodeInfo { "Error code declares parameters using a `parameters` entry, but " "doesn't use them", ); - } else if (!literateApiEnabled || parameters == null) { + } else if (parameters == null) { // Do not generate literate API yet. className = errorClassInfo.name; } else if (parameters.isNotEmpty) { diff --git a/pkg/analyzer/tool/messages/generate.dart b/pkg/analyzer/tool/messages/generate.dart index 58eae7cdecd..58f46a48167 100644 --- a/pkg/analyzer/tool/messages/generate.dart +++ b/pkg/analyzer/tool/messages/generate.dart @@ -190,12 +190,10 @@ DiagnosticType get type => ${errorClass.typeCode}; memberAccumulator.writeTo(out); out.writeln('}'); - if (literateApiEnabled) { - out.writeln(); - _outputDerivedClass(errorClass, withArguments: true); - out.writeln(); - _outputDerivedClass(errorClass, withArguments: false); - } + out.writeln(); + _outputDerivedClass(errorClass, withArguments: true); + out.writeln(); + _outputDerivedClass(errorClass, withArguments: false); } } diff --git a/pkg/linter/tool/generate_lints.dart b/pkg/linter/tool/generate_lints.dart index 78a0c2e7ec5..bee1d1ad5d9 100644 --- a/pkg/linter/tool/generate_lints.dart +++ b/pkg/linter/tool/generate_lints.dart @@ -51,15 +51,9 @@ GeneratedFile get generatedCodesFile => // Generator currently outputs double quotes for simplicity. // ignore_for_file: prefer_single_quotes -'''); - if (literateApiEnabled) { - out.write(''' // Generated `withArguments` methods always use block bodies for simplicity. // ignore_for_file: prefer_expression_function_bodies -'''); - } - out.write(''' part of 'lint_codes.dart'; @@ -114,8 +108,7 @@ class LinterLintCode extends LintCodeWithExpectedTypes { memberAccumulator.writeTo(out); out.writeln('}'); - if (literateApiEnabled) { - out.write(''' + out.write(''' final class LinterLintTemplate extends LinterLintCode { final T withArguments; @@ -145,7 +138,6 @@ final class LinterLintWithoutArguments extends LinterLintCode }); } '''); - } return out.toString(); });