cobalt_analyzer library
Shared static analysis layer for Cobalt.
Turns annotated Dart source into a typed intermediate representation that
both cobalt_generator and cobalt_lint consume, so a declaration is parsed
by one implementation rather than two that drift apart.
Depends on analyzer but deliberately not on build or the plugin API,
which is what keeps the build system out of the analysis server.
Classes
- CobaltAnnotationMatcher
- Matches an annotation by class name and owning package.
- CobaltBootstrapParser
- CobaltBootstrapStepClass
- CobaltDecoratorClass
- A class the container builds around a registration instead of registering.
- CobaltDecoratorParser
-
Reads an
@CobaltDecoratesclass into the wrapper the container applies. - CobaltFunctionRef
- A reference to a function the generated code calls by name.
- CobaltHookClass
-
An
@CobaltHookAllclass: aCobaltHookthe generated root scope adds. - CobaltHookParser
-
Reads an
@CobaltHookAllclass into the hook the root scope adds. - CobaltInjectableClass
- CobaltInjectableParser
- CobaltInjectedProperty
- CobaltLibraryDeclarations
- CobaltModuleParser
-
Reads an
@CobaltModuleclass into one registration per annotated member. - CobaltParser
- Reads every Cobalt declaration out of one library.
- CobaltProvidedRef
- CobaltProviderRef
- The module member that builds a registration.
- CobaltScopeRootClass
- CobaltScopeRootParser
- CobaltTypeRef
Enums
- CobaltLifetime
-
How long an instance registered with
CobaltInjectlives.
Extensions
- CobaltDartObject on DartObject
Constants
- bootstrapMatcher → const CobaltAnnotationMatcher
- cobaltAnnotationsPackage → const String
- decoratesMatcher → const CobaltAnnotationMatcher
- environmentMatcher → const CobaltAnnotationMatcher
- hookAllMatcher → const CobaltAnnotationMatcher
- initMatcher → const CobaltAnnotationMatcher
- injectedMatcher → const CobaltAnnotationMatcher
- injectMatcher → const CobaltAnnotationMatcher
- moduleMatcher → const CobaltAnnotationMatcher
- namedMatcher → const CobaltAnnotationMatcher
- paramMatcher → const CobaltAnnotationMatcher
-
Matches
@CobaltParamon a constructor parameter. - scopeRootMatcher → const CobaltAnnotationMatcher
Functions
-
layeredTopologicalSort<
T extends Object> (Iterable< T> nodes, CobaltDependenciesOf<T> dependenciesOf, {required String labelOf(T node)}) → List<List< T> > -
Sorts
nodesinto dependency levels. -
typeRefOf(
DartType type) → CobaltTypeRef -
typeRefOfElement(
InterfaceElement element) → CobaltTypeRef
Exceptions / Errors
- CobaltCycleError
- Thrown when dependencies form a cycle.
- CobaltParseError
- A declaration Cobalt cannot turn into a registration.