From 56cb8de9736e7070151f5ee46519587503e1ef3a Mon Sep 17 00:00:00 2001 From: Keerti Parthasarathy Date: Mon, 5 Jun 2023 16:43:24 +0000 Subject: [PATCH] Make ParsedUnitResult and ParsedLibraryResult superclasses of ResolvedUnitResult and ResolvedLibraryResult respectively. Change-Id: I00a8c07b8487c27c22997523803028fd01b4293a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/306909 Reviewed-by: Brian Wilkerson Commit-Queue: Keerti Parthasarathy --- pkg/analyzer/lib/dart/analysis/results.dart | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/pkg/analyzer/lib/dart/analysis/results.dart b/pkg/analyzer/lib/dart/analysis/results.dart index b4785445404..857b5a1956c 100644 --- a/pkg/analyzer/lib/dart/analysis/results.dart +++ b/pkg/analyzer/lib/dart/analysis/results.dart @@ -234,7 +234,7 @@ abstract class ParseStringResult { /// /// Clients may not extend, implement or mix-in this class. abstract class ResolvedLibraryResult - implements SomeResolvedLibraryResult, AnalysisResult { + implements ParsedLibraryResult, SomeResolvedLibraryResult { /// The element representing this library. LibraryElement get element; @@ -242,13 +242,9 @@ abstract class ResolvedLibraryResult TypeProvider get typeProvider; /// The resolved units of the library. + @override List get units; - /// Return the declaration of the [element], or `null` if the [element] - /// is synthetic. Throw [ArgumentError] if the [element] is not defined in - /// this library. - ElementDeclarationResult? getElementDeclaration(Element element); - /// Return the resolved unit corresponding to the [path], or `null` if there /// is no such unit. ResolvedUnitResult? unitWithPath(String path); @@ -259,10 +255,7 @@ abstract class ResolvedLibraryResult /// /// Clients may not extend, implement or mix-in this class. abstract class ResolvedUnitResult - implements SomeResolvedUnitResult, AnalysisResultWithErrors { - /// The content of the file that was scanned, parsed and resolved. - String get content; - + implements ParsedUnitResult, SomeResolvedUnitResult { /// Return `true` if the file exists. bool get exists; @@ -274,9 +267,6 @@ abstract class ResolvedUnitResult /// The type system used when resolving the compilation [unit]. TypeSystem get typeSystem; - - /// The fully resolved compilation unit for the [content]. - CompilationUnit get unit; } /// The result of computing all of the errors contained in a single file, both