FileContext class

A helper class for a file located at path that provides access to its contents and analyzed formats like CompilationUnit and LibraryElement.

Constructors

FileContext(String path, AnalysisContextCollection _analysisContextCollection, {String? root})

Properties

hashCode int
The hash code for this object.
no setterinherited
path String
This file's absolute path.
final
relativePath String
This file's path relative to root.
final
root String
The path to the working directory from which this file was discovered.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceFile → SourceFile
A representation of this file that makes it easy to reference spans of text, which is useful for the creation of SourcePatches.
latefinal
sourceText String
The contents of this file.
latefinal

Methods

getResolvedLibrary() Future<ResolvedLibraryResult?>
Uses the analyzer to resolve and return the library result for this file, which includes the LibraryElement.
getResolvedUnit() Future<ResolvedUnitResult?>
Uses the analyzer to resolve and return the AST result for this file, which includes the CompilationUnit.
getUnresolvedUnit() → CompilationUnit
Returns the unresolved AST for this file.
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