From 55ce1164c418a14d374646e9794dafa14d3b7006 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Tue, 10 Sep 2024 10:24:02 -0700 Subject: [PATCH] Use latest language version for DartFormatter (#3875) --- .../templates.runtime_renderers.dart | 20 +++++++++++++++++++ pubspec.yaml | 2 +- tool/mustachio/codegen_aot_compiler.dart | 3 ++- tool/mustachio/codegen_runtime_renderer.dart | 3 ++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/src/generator/templates.runtime_renderers.dart b/lib/src/generator/templates.runtime_renderers.dart index effe17e03a..3da516678e 100644 --- a/lib/src/generator/templates.runtime_renderers.dart +++ b/lib/src/generator/templates.runtime_renderers.dart @@ -15901,13 +15901,18 @@ const _invisibleGetters = { 'accessors', 'classes', 'enclosingElement', + 'enclosingElement3', 'enums', 'extensionTypes', 'extensions', 'functions', 'hashCode', + 'libraryExports', + 'libraryImportPrefixes', + 'libraryImports', 'lineInfo', 'mixins', + 'parts', 'runtimeType', 'session', 'topLevelVariables', @@ -15925,6 +15930,7 @@ const _invisibleGetters = { 'declaration', 'displayName', 'enclosingElement', + 'enclosingElement3', 'hashCode', 'isConst', 'isDefaultConstructor', @@ -16040,6 +16046,7 @@ const _invisibleGetters = { 'displayName', 'documentationComment', 'enclosingElement', + 'enclosingElement3', 'hasAlwaysThrows', 'hasDeprecated', 'hasDoNotStore', @@ -16095,11 +16102,15 @@ const _invisibleGetters = { 'ExecutableMember': { 'augmentationSubstitution', 'children', + 'children3', 'context', 'declaration', 'displayName', 'documentationComment', + 'element', 'enclosingElement', + 'enclosingElement3', + 'enclosingFragment', 'hasAlwaysThrows', 'hasDeprecated', 'hasDoNotStore', @@ -16145,14 +16156,18 @@ const _invisibleGetters = { 'isSynthetic', 'kind', 'library', + 'libraryFragment', 'librarySource', 'location', 'metadata', 'name', 'nameLength', 'nameOffset', + 'nextFragment', 'nonSynthetic', 'parameters', + 'parameters2', + 'previousFragment', 'returnType', 'runtimeType', 'session', @@ -16318,6 +16333,7 @@ const _invisibleGetters = { }, 'Kind': {'hashCode', 'index', 'runtimeType'}, 'LibraryElement': { + 'enclosingElement3', 'entryPoint', 'exportNamespace', 'exportedLibraries', @@ -16363,6 +16379,7 @@ const _invisibleGetters = { 'displayName', 'documentationComment', 'enclosingElement', + 'enclosingElement3', 'hasAlwaysThrows', 'hasDeprecated', 'hasDoNotStore', @@ -16512,6 +16529,7 @@ const _invisibleGetters = { 'displayName', 'documentationComment', 'enclosingElement', + 'enclosingElement3', 'hasAlwaysThrows', 'hasDefaultValue', 'hasDeprecated', @@ -16581,6 +16599,7 @@ const _invisibleGetters = { 'correspondingSetter', 'declaration', 'enclosingElement', + 'enclosingElement3', 'hashCode', 'isGetter', 'isSetter', @@ -16611,6 +16630,7 @@ const _invisibleGetters = { 'aliasedElement', 'aliasedType', 'enclosingElement', + 'enclosingElement3', 'hashCode', 'isAugmentation', 'name', diff --git a/pubspec.yaml b/pubspec.yaml index cebfba7012..e997ba3f58 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -25,7 +25,7 @@ dependencies: dev_dependencies: async: ^2.11.0 - dart_style: ^2.3.4 + dart_style: ^2.3.7 lints: ^4.0.0 matcher: ^0.12.15 test: ^1.24.2 diff --git a/tool/mustachio/codegen_aot_compiler.dart b/tool/mustachio/codegen_aot_compiler.dart index 2cdf2e6b9b..b6b583c809 100644 --- a/tool/mustachio/codegen_aot_compiler.dart +++ b/tool/mustachio/codegen_aot_compiler.dart @@ -60,7 +60,8 @@ Future compileTemplatesToRenderers( buffer.writeln(); buffer.writeln(); } - return DartFormatter().format(''' + return DartFormatter(languageVersion: DartFormatter.latestLanguageVersion) + .format(''' // GENERATED CODE. DO NOT EDIT. // // To change the contents of this library, make changes to the builder source diff --git a/tool/mustachio/codegen_runtime_renderer.dart b/tool/mustachio/codegen_runtime_renderer.dart index 780d1da95b..9bd7c851da 100644 --- a/tool/mustachio/codegen_runtime_renderer.dart +++ b/tool/mustachio/codegen_runtime_renderer.dart @@ -29,7 +29,8 @@ String buildRuntimeRenderers(Set specs, Uri sourceUri, sourceUri, typeProvider, typeSystem, visibleElements, rendererClassesArePublic: rendererClassesArePublic) ._buildTemplateRenderers(specs); - return DartFormatter().format(raw); + return DartFormatter(languageVersion: DartFormatter.latestLanguageVersion) + .format(raw); } /// This class builds runtime Mustache renderers from a set of [RendererSpec]s.