From b45cdff83a9bea6863043c90ab9952058b682999 Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Thu, 23 Oct 2025 11:04:21 -0700 Subject: [PATCH] CQ. Remove more deprecated non-APIs. Change-Id: I546a30eaa6b18f68349d9941ffc36d8a5368592d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456861 Reviewed-by: Brian Wilkerson Commit-Queue: Konstantin Shcheglov --- pkg/analyzer/CHANGELOG.md | 1 + pkg/analyzer/api.txt | 1 - pkg/analyzer/lib/dart/analysis/utilities.dart | 19 ------------------- .../lib/src/dart/analysis/driver.dart | 9 +-------- pkg/analyzer/lib/src/generated/sdk.dart | 2 +- .../lib/src/generated/timestamped_data.dart | 16 ---------------- 6 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 pkg/analyzer/lib/src/generated/timestamped_data.dart diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md index a7e8fc06a42..f0787b888e2 100644 --- a/pkg/analyzer/CHANGELOG.md +++ b/pkg/analyzer/CHANGELOG.md @@ -14,6 +14,7 @@ * Remove deprecated `PartDirective.configurations`. * Remove deprecated `TypeDefiningElement`. * Remove deprecated `TypeAliasElement.aliasedElement`. +* Remove deprecated `resolveFile2`. * Remove deprecated `ErrorCode`. * Remove deprecated `ErrorSeverity`. * Remove deprecated `ErrorType`. diff --git a/pkg/analyzer/api.txt b/pkg/analyzer/api.txt index 8c1f8d9f7b9..1c0f1c0112b 100644 --- a/pkg/analyzer/api.txt +++ b/pkg/analyzer/api.txt @@ -577,7 +577,6 @@ package:analyzer/dart/analysis/utilities.dart: parseFile (function: ParseStringResult Function({required FeatureSet featureSet, required String path, ResourceProvider? resourceProvider, bool throwIfDiagnostics})) parseString (function: ParseStringResult Function({required String content, FeatureSet? featureSet, String? path, bool throwIfDiagnostics})) resolveFile (function: Future Function({required String path, ResourceProvider? resourceProvider})) - resolveFile2 (function: Future Function({required String path, ResourceProvider? resourceProvider}), deprecated) package:analyzer/dart/ast/ast.dart: useDeclaringConstructorsAst (static getter: bool) useDeclaringConstructorsAst= (static setter: bool) diff --git a/pkg/analyzer/lib/dart/analysis/utilities.dart b/pkg/analyzer/lib/dart/analysis/utilities.dart index e6e123cefd2..70807a596ad 100644 --- a/pkg/analyzer/lib/dart/analysis/utilities.dart +++ b/pkg/analyzer/lib/dart/analysis/utilities.dart @@ -140,25 +140,6 @@ Future resolveFile({ return await context.currentSession.getResolvedUnit(path); } -/// Return the result of resolving the file at the given [path]. -/// -/// If a [resourceProvider] is given, it will be used to access the file system. -/// -/// Note that if more than one file is going to be resolved then this function -/// is inefficient. Clients should instead use [AnalysisContextCollection] to -/// create one or more contexts and use those contexts to resolve the files. -@Deprecated('Use resolveFile instead') -Future resolveFile2({ - required String path, - ResourceProvider? resourceProvider, -}) async { - AnalysisContext context = _createAnalysisContext( - path: path, - resourceProvider: resourceProvider, - ); - return await context.currentSession.getResolvedUnit(path); -} - /// Return a newly create analysis context in which the file at the given [path] /// can be analyzed. /// diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart index 8e380fabbb0..e39a2b2b0a9 100644 --- a/pkg/analyzer/lib/src/dart/analysis/driver.dart +++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart @@ -299,9 +299,7 @@ class AnalysisDriver { required this.withFineDependencies, this.ownedFiles, this.analysisContext, - @Deprecated("Use 'analysisOptionsMap' instead") - AnalysisOptionsImpl? analysisOptions, - AnalysisOptionsMap? analysisOptionsMap, + required this.analysisOptionsMap, FileContentCache? fileContentCache, UnlinkedUnitStore? unlinkedUnitStore, this.enableIndex = false, @@ -324,11 +322,6 @@ class AnalysisDriver { declaredVariables = declaredVariables ?? DeclaredVariables(), testingData = retainDataForTesting ? TestingData() : null, _enableLintRuleTiming = enableLintRuleTiming, - // This '!' is temporary. The analysisOptionsMap is effectively - // required but can't be until Google3 is updated. - analysisOptionsMap = analysisOptions == null - ? analysisOptionsMap! - : AnalysisOptionsMap.forSharedOptions(analysisOptions), _saltForUnlinked = _calculateSaltForUnlinked(enableIndex: enableIndex), _saltForElements = _calculateSaltForElements( declaredVariables ?? DeclaredVariables(), diff --git a/pkg/analyzer/lib/src/generated/sdk.dart b/pkg/analyzer/lib/src/generated/sdk.dart index f9acbeee9b1..c8782dc0c32 100644 --- a/pkg/analyzer/lib/src/generated/sdk.dart +++ b/pkg/analyzer/lib/src/generated/sdk.dart @@ -77,7 +77,7 @@ class DartSdkManager { Map sdkMap = HashMap(); /// Initialize a newly created manager. - DartSdkManager(this.defaultSdkDirectory, [@deprecated bool? canUseSummaries]); + DartSdkManager(this.defaultSdkDirectory); /// Return any SDK that has been created, or `null` if no SDKs have been /// created. diff --git a/pkg/analyzer/lib/src/generated/timestamped_data.dart b/pkg/analyzer/lib/src/generated/timestamped_data.dart deleted file mode 100644 index 54beadf0183..00000000000 --- a/pkg/analyzer/lib/src/generated/timestamped_data.dart +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -@Deprecated('Please use package:analyzer/source/timestamped_data.dart instead.') -library; - -// This export is needed because there are versions of package `dartdoc` that -// import the `TimestampedData` class from here. -// -// All of those versions have an analyzer constraint < 9.0.0, so once the -// analyzer version gets bumped to 9.0.0, it will be safe to remove this file. -// -// TODO(paulberry): remove this file in analyzer version 9.0.0. - -export 'package:analyzer/source/timestamped_data.dart' show TimestampedData;