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 @CobaltDecorates class into the wrapper the container applies.
CobaltFunctionRef
A reference to a function the generated code calls by name.
CobaltHookClass
An @CobaltHookAll class: a CobaltHook the generated root scope adds.
CobaltHookParser
Reads an @CobaltHookAll class into the hook the root scope adds.
CobaltInjectableClass
CobaltInjectableParser
CobaltInjectedProperty
CobaltLibraryDeclarations
CobaltModuleParser
Reads an @CobaltModule class 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 CobaltInject lives.

Extensions

CobaltDartObject on DartObject

Functions

layeredTopologicalSort<T extends Object>(Iterable<T> nodes, CobaltDependenciesOf<T> dependenciesOf, {required String labelOf(T node)}) → List<List<T>>
Sorts nodes into 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.