plugin_api library
The API for an analyzer plugin built on top of async_job_lints.
A plugin that wants the rules of async_job_lints under its own name calls
registerAsyncJobLints from its register, and may reuse the recognizers
exported here for rules of its own. This library is not meant for the code
a plugin checks. It follows semver with the package.
Functions
-
cleanupContext(
Expression node) → Element? -
The context
nodeis registered as cleanup on, if it is one. -
firstPositional(
ArgumentList list) → Expression? -
The value of the first positional argument of
list, if there is one. -
functionOf(
Expression argument) → FunctionExpression? -
The function
argumentstands for: a literal, the declaration of the local function it names or the literal a final local variable it names holds;nullfor anything else. -
isDartCoreClass(
Element? element, String name) → bool -
Whether
elementis the classnamedeclared indart:core. -
isFromJobPackages(
Element? element) → bool -
Whether
elementcomes from a library of async_job or solo. -
isJobContext(
DartType? type) → bool -
Whether
typeisJobContextof async_job or one of its subtypes. -
isSolo(
DartType? type) → bool -
Whether
typeisSoloof solo or one of its subclasses. -
isSoloContext(
DartType? type) → bool -
Whether
typeisSoloContextof solo or one of its subtypes. -
isSoloMember(
Element? element, String type, String name) → bool -
Whether
elementis the membernameof the class or enumtypedeclared in solo. -
jobContextOf(
FunctionExpression node) → FormalParameterElement? -
The context of
nodewhen it is a job body: its first parameter, if that is typedJobContextor a subtype. -
namedValue(
ArgumentList list, String name) → Expression? -
The value of the argument
nameoflist, if it is given. -
ownQueueCall(
Expression waited) → MethodInvocation? -
The call of the enclosing controller's own queue that
waitedwaits for:method(...).valueandmethod(...).donefor a method that returns aSoloJob, andclose()andcancelAll(). -
registerAsyncJobLints(
PluginRegistry registry, {bool ownQueueReportedElsewhere = false}) → void -
Registers the rules of async_job_lints and their quick fixes in
registry. -
returnedValues(
FunctionBody body) → List< Expression> -
The values
bodyreturns: its expression, or the values of the return statements of its block outside the functions declared in it. -
waitingContext(
FunctionExpression node) → Element? -
The context of the waiting call whose action
nodeis, otherwisenull.