AnalysisContextHelper class
Helper for initializing analyzer AnalysisContextCollection instances
and safely resolving compilation units.
Constructors
-
AnalysisContextHelper({required List<
String> includedPaths, String? sdkPath}) -
Creates an AnalysisContextHelper for the specified
includedPaths.factory
Properties
- collection → AnalysisContextCollection
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
includedPaths
→ List<
String> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sdkPath → String
-
final
Methods
-
contextFor(
String filePath) → AnalysisContext -
Returns the
AnalysisContextfor the givenfilePath. -
getRequiredResolvedUnit(
String filePath) → Future< ResolvedUnitResult> -
Resolves the unit at
filePath, throwing a StateError if resolution fails or the file does not exist. -
getResolvedUnit(
String filePath) → Future< ResolvedUnitResult?> -
Safely resolves the unit at
filePath. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
resolveFile(
String filePath, {String? sdkPath}) → Future< ResolvedUnitResult> - Convenience method to resolve a single file in a temporary context.