analysis_server_plugin_core library

Core components to build a custom Dart analysis server plugin.

Classes

AbstractAnalysisRule
Describes a static analysis rule, either a lint rule (which must be enabled via analysis options) or a warning rule (which is enabled by default).
AdjacentStrings
Two or more string literals that are implicitly concatenated because of being adjacent (separated only by whitespace).
AnalysisRule
Describes an AbstractAnalysisRule which reports exactly one type of diagnostic (one DiagnosticCode).
AnnotatedNode
An AST node that can be annotated with either a documentation comment, a list of annotations (metadata), or both.
Annotation
An annotation that can be associated with a declaration.
AnnotationTypeResolver
AnnotationTypeResolverFactory
ArgumentList
A list of arguments in the invocation of an executable element (that is, a function, method, or constructor).
AsExpression
An as expression.
AssertInitializer
An assert in the initializer list of a constructor.
Assertion
An assertion, either in a block or in the initializer list of a constructor.
AssertStatement
An assert statement.
AssignedVariablePattern
A variable pattern in PatternAssignment.
AssignmentExpression
An assignment expression.
AstNode
A node in the AST structure for a Dart program.
AstVisitor<R>
An object that can be used to visit an AST structure.
AwaitExpression
An await expression.
BinaryExpression
A binary (infix) expression.
Block
A sequence of statements.
BlockClassBody
The class body with members.
BlockFunctionBody
A function body that consists of a block of statements.
BooleanLiteral
A boolean literal expression.
BreadthFirstVisitor<R>
An AST visitor that will recursively visit all of the nodes in an AST structure, similar to GeneralizingAstVisitor. This visitor uses a breadth-first ordering rather than the depth-first ordering of GeneralizingAstVisitor.
BreakStatement
A break statement.
CascadeExpression
A sequence of cascaded expressions: expressions that share a common target.
CaseClause
The case clause that can optionally appear in an if statement.
CastPattern
A cast pattern.
CatchClause
A catch clause within a try statement.
CatchClauseParameter
An 'exception' or 'stackTrace' parameter in CatchClause.
ClassBody
The body of a class declaration.
ClassDeclaration
The declaration of a class.
ClassMember
A node that declares a name within the scope of a class, enum, extension, extension type, or mixin declaration.
ClassNamePart
The name of a class, enum, or extension type declaration.
ClassTypeAlias
A class type alias.
CollectionElement
CollectionTypeResolver
Resolves whether a TypeAnnotation represents a specific collection type, such as List<T> or Map<K, V>, using the analyzer's element model.
CollectionTypeResolverFactory
Combinator
A combinator associated with an import or export directive.
Comment
A comment within the source code.
CommentReferableExpression
An interface for an Expression which can make up a CommentReference.
CommentReference
A reference to a Dart element that is found within a documentation comment.
CompilationUnit
A compilation unit.
CompilationUnitMember
A node that declares one or more names within the scope of a compilation unit.
CompoundAssignmentExpression
A potentially compound assignment.
ConditionalExpression
A conditional expression.
Configuration
A configuration in either an import or export directive.
ConstantPattern
A constant expression being used as a pattern.
ConstantValueAnnotationTypeResolver
ConstructorDeclaration
A constructor declaration.
ConstructorFieldInitializer
The initialization of a field within a constructor's initialization list.
ConstructorInitializer
A node that can occur in the initializer list of a constructor declaration.
ConstructorName
The name of a constructor.
ConstructorReference
An expression representing a reference to a constructor.
ConstructorReferenceNode
An AST node that makes reference to a constructor.
ConstructorSelector
The name of a constructor being invoked.
ContextConfig
ContextConfigLoader<C extends ContextConfig>
ContinueStatement
A continue statement.
DartPattern
A pattern.
Declaration
A node that represents the declaration of one or more names.
DeclaredIdentifier
The declaration of a single identifier.
DeclaredVariablePattern
A variable pattern that declares a variable.
DefaultCollectionTypeResolver
DefaultFormalParameter
A formal parameter with a default value.
DelegatingAstVisitor<T>
An AST visitor that will recursively visit all of the nodes in an AST structure. For each node that is visited, the corresponding visit method on one or more other visitors (the 'delegates') will be invoked.
DiagnosticCode
An error code associated with an AnalysisError.
DiagnosticSeverity
The severity of an DiagnosticCode.
DiagnosticType
The type of a DiagnosticCode.
Directive
A node that represents a directive.
DoStatement
A do statement.
DotShorthandConstructorInvocation
A node that represents a dot shorthand constructor invocation.
DotShorthandInvocation
A node that represents a dot shorthand static method or constructor invocation.
DotShorthandPropertyAccess
A node that represents a dot shorthand property access of a field or a static getter.
DottedName
A dotted name, used in a configuration within an import or export directive.
DoubleLiteral
A floating point literal expression.
EmptyClassBody
The empty class body.
EmptyFunctionBody
An empty function body.
EmptyStatement
An empty statement.
EnumBody
The enum declaration body, with constants and members.
EnumConstantArguments
The arguments part of an enum constant.
EnumConstantDeclaration
The declaration of an enum constant.
EnumDeclaration
The declaration of an enumeration.
ExportDirective
An export directive.
Expression
A node that represents an expression.
ExpressionFunctionBody
A function body consisting of a single expression.
ExpressionStatement
An expression used as a statement.
ExtendsClause
The "extends" clause in a class declaration.
ExtensionDeclaration
The declaration of an extension of a type.
ExtensionOnClause
The on clause in an extension declaration.
ExtensionOverride
An override to force resolution to choose a member from a specific extension.
ExtensionTypeDeclaration
The declaration of an extension type.
FieldDeclaration
The declaration of one or more fields of the same type.
FieldFormalParameter
A field formal parameter.
ForEachParts
The parts of a for-each loop that control the iteration.
ForEachPartsWithDeclaration
The parts of a for-each loop that control the iteration when the loop variable is declared as part of the for loop.
ForEachPartsWithIdentifier
The parts of a for-each loop that control the iteration when the loop variable is declared outside of the for loop.
ForEachPartsWithPattern
A for-loop part with a pattern.
ForElement
The basic structure of a for element.
ForLoop<Body extends AstNode>
A for or for-each statement or collection element.
ForLoopParts
The parts of a for or for-each loop that control the iteration.
FormalParameter
A node representing a parameter to a function.
FormalParameterList
The formal parameter list of a method declaration, function declaration, or function type alias.
ForParts
The parts of a for loop that control the iteration.
ForPartsWithDeclarations
The parts of a for loop that control the iteration when there are one or more variable declarations as part of the for loop.
ForPartsWithExpression
The parts of a for loop that control the iteration when there are no variable declarations as part of the for loop.
ForPartsWithPattern
The parts of a for loop that control the iteration when there's a pattern declaration as part of the for loop.
ForStatement
A for or for-each statement.
FunctionBody
A node representing the body of a function or method.
FunctionDeclaration
A function declaration.
FunctionDeclarationStatement
A FunctionDeclaration used as a statement.
FunctionExpression
A function expression.
FunctionExpressionInvocation
The invocation of a function resulting from evaluating an expression.
FunctionReference
An expression representing a reference to a function, possibly with type arguments applied to it.
FunctionTypeAlias
A function type alias.
FunctionTypedFormalParameter
A function-typed formal parameter.
GeneralizingAstVisitor<R>
An AST visitor that will recursively visit all of the nodes in an AST structure (like instances of the class RecursiveAstVisitor). In addition, when a node of a specific type is visited not only will the visit method for that specific type of node be invoked, but additional methods for the superclasses of that node will also be invoked. For example, using an instance of this class to visit a Block will cause the method visitBlock to be invoked but will also cause the methods visitStatement and visitNode to be subsequently invoked. This allows visitors to be written that visit all statements without needing to override the visit method for each of the specific subclasses of Statement.
GenericFunctionType
An anonymous function type.
GenericTypeAlias
A generic type alias.
GuardedPattern
The pattern with an optional WhenClause.
HideCombinator
A combinator that restricts the names being imported to those that aren't in a given list.
Identifier
A node that represents an identifier.
IfElement
The basic structure of an if element.
IfStatement
An if statement.
ImplementsClause
The "implements" clause in an class declaration.
ImplicitCallReference
An expression representing an implicit 'call' method reference.
ImportDirective
An import directive.
ImportPrefixReference
Reference to an import prefix name.
IndexExpression
An index expression.
InstanceCreationExpression
An instance creation expression.
IntegerLiteral
An integer literal expression.
InterpolationElement
A node within a StringInterpolation.
InterpolationExpression
An expression embedded in a string interpolation.
InterpolationString
A non-empty substring of an interpolated string.
InvocationExpression
The invocation of a function or method.
IsExpression
An is expression.
Label
A label on either a LabeledStatement or a NamedExpression.
LabeledStatement
A statement that has a label associated with them.
LibraryDirective
A library directive.
LibraryIdentifier
The identifier for a library.
LintCode
Diagnostic codes which are not reported by default.
ListLiteral
A list literal.
ListPattern
A list pattern.
ListPatternElement
An element of a list pattern.
Literal
A node that represents a literal expression.
LogConfig
LogicalAndPattern
A logical-and pattern.
LogicalOrPattern
A logical-or pattern.
MapLiteralEntry
A single key/value pair in a map literal.
MapPattern
A map pattern.
MapPatternElement
An element of a map pattern.
MapPatternEntry
An entry in a map pattern.
MethodDeclaration
A method declaration.
MethodInvocation
The invocation of either a function or a method.
MethodReferenceExpression
An expression that implicitly makes reference to a method.
MixinDeclaration
The declaration of a mixin.
MixinOnClause
The "on" clause in a mixin declaration.
MultiAnalysisRule
Describes an AbstractAnalysisRule which reports diagnostics using multiple DiagnosticCodes).
NamedCompilationUnitMember
A node that declares a single name within the scope of a compilation unit.
NamedExpression
An expression that has a name associated with it.
NamedType
A named type, which can optionally include type arguments.
NamespaceDirective
A node that represents a directive that impacts the namespace of a library.
NameWithTypeParameters
The type name with optional type parameters.
NativeClause
The "native" clause in an class declaration.
NativeFunctionBody
A function body that consists of a native keyword followed by a string literal.
NodeList<E extends AstNode>
A list of AST nodes that have a common parent.
NormalFormalParameter
A formal parameter that is required (isn't optional).
NullAssertPattern
A null-assert pattern.
NullAwareElement
A null-aware element in a list or set literal.
NullCheckPattern
A null-check pattern.
NullLiteral
A null literal expression.
NullShortableExpression
Abstract interface for expressions that may participate in null-shorting.
ObjectPattern
An object pattern.
PackageInfo
ParenthesizedExpression
A parenthesized expression.
ParenthesizedPattern
A parenthesized pattern.
PartDirective
A part directive.
PartOfDirective
A part-of directive.
PatternAssignment
A pattern assignment.
PatternField
A field in an object or record pattern.
PatternFieldName
A field name in an object or record pattern field.
PatternVariableDeclaration
A pattern variable declaration.
PatternVariableDeclarationStatement
A pattern variable declaration statement.
Plugin
PluginBuilder<C extends ContextConfig>
A type-safe builder for constructing a Plugin.
PluginRegistry
PostfixExpression
A postfix unary expression.
PrefixedIdentifier
An identifier that is prefixed or an access to an object property where the target of the property access is a simple identifier.
PrefixExpression
A prefix unary expression.
PrimaryConstructorDeclaration
The declaration of a primary constructor.
PrimaryConstructorName
The name of a primary constructor.
PropertyAccess
The access of a property of an object.
RecordLiteral
A record literal.
RecordPattern
A record pattern.
RecordTypeAnnotation
A record type.
RecordTypeAnnotationField
A field in a RecordTypeAnnotation.
RecordTypeAnnotationNamedField
A named field in a RecordTypeAnnotation.
RecordTypeAnnotationNamedFields
The portion of a RecordTypeAnnotation with named fields.
RecordTypeAnnotationPositionalField
A positional field in a RecordTypeAnnotation.
RecursiveAstVisitor<R>
An AST visitor that will recursively visit all of the nodes in an AST structure. For example, using an instance of this class to visit a Block will also cause all of the statements in the block to be visited.
RedirectingConstructorInvocation
The invocation of a constructor in the same class from within a constructor's initialization list.
RelationalPattern
A relational pattern.
RepresentationConstructorName
The name of the primary constructor of an extension type.
RepresentationDeclaration
The declaration of an extension type representation.
RestPatternElement
A rest pattern element.
RethrowExpression
A rethrow expression.
ReturnStatement
A return statement.
RuleContext
Provides access to information needed by analysis rules that is not available from AST nodes or the element model.
RuleContextUnit
Provides access to information needed by analysis rules that is not available from AST nodes or the element model.
RuleMetadata
RuleSessionContext<T extends ContextConfig>
RuleVisitorRegistry
The container to register visitors for separate AST node types.
ScanConfig
ScriptTag
A script tag that can optionally occur at the beginning of a compilation unit.
SessionDataManager
SessionDataManagerFactory
SessionDataManagerImpl
SessionLogger
SessionLoggerImpl
SessionManagedAnalysisRule<T extends ContextConfig>
SetOrMapLiteral
A set or map literal.
ShowCombinator
A combinator that restricts the names being imported to those in a given list.
SimpleAstVisitor<R>
An AST visitor that will do nothing when visiting an AST node. It is intended to be a superclass for classes that use the visitor pattern primarily as a dispatch mechanism (and hence don't need to recursively visit a whole structure) and that only need to visit a small number of node types.
SimpleFormalParameter
A simple formal parameter.
SimpleIdentifier
A simple identifier.
SimpleStringLiteral
A string literal expression that doesn't contain any interpolations.
SingleStringLiteral
A single string literal expression.
SpreadElement
A spread element.
Statement
A node that represents a statement.
StringInterpolation
A string interpolation literal.
StringLiteral
A string literal expression.
SuperConstructorInvocation
The invocation of a superclass' constructor from within a constructor's initialization list.
SuperExpression
A super expression.
SuperFormalParameter
A super-initializer formal parameter.
SwitchCase
A case in a switch statement.
SwitchDefault
The default case in a switch statement.
SwitchExpression
A switch expression.
SwitchExpressionCase
A case in a switch expression.
SwitchMember
An element within a switch statement.
SwitchPatternCase
A pattern-based case in a switch statement.
SwitchStatement
A switch statement.
SymbolLiteral
A symbol literal expression.
ThisExpression
A this expression.
ThrowExpression
A throw expression.
ThrowingAstVisitor<R>
An AST visitor that will throw an exception if any of the visit methods that are invoked have not been overridden. It is intended to be a superclass for classes that implement the visitor pattern and need to (a) override all of the visit methods or (b) need to override a subset of the visit method and want to catch when any other visit methods have been invoked.
TimedAstVisitor<T>
An AST visitor that captures visit call timings.
TopLevelVariableDeclaration
The declaration of one or more top-level variables of the same type.
TryStatement
A try statement.
TypeAlias
The declaration of a type alias.
TypeAnnotation
A type annotation.
TypeArgumentList
A list of type arguments.
TypedLiteral
A literal that has a type associated with it.
TypeLiteral
An expression representing a type, such as the expression int in var x = int;.
TypeParameter
A type parameter.
TypeParameterList
Type parameters within a declaration.
UnifyingAstVisitor<R>
An AST visitor that will recursively visit all of the nodes in an AST structure (like instances of the class RecursiveAstVisitor). In addition, every node will also be visited by using a single unified visitNode method.
UriBasedDirective
A directive that references a URI.
VariableDeclaration
An identifier that has an initial value associated with it.
VariableDeclarationList
The declaration of one or more variables of the same type.
VariableDeclarationStatement
A list of variables that are being declared in a context where a statement is required.
VariablePattern
The shared interface of AssignedVariablePattern and DeclaredVariablePattern.
WhenClause
A guard in a pattern-based case in a switch statement, switch expression, if statement, or if element.
WhileStatement
A while statement.
WildcardPattern
A wildcard pattern.
WithClause
The with clause in a class declaration.
WorkspacePackage
YieldStatement
A yield statement.

Properties

errorCodeValues List<DiagnosticCode>
no setter

Functions

errorCodeByUniqueName(String uniqueName) DiagnosticCode?
Return the DiagnosticCode with the given uniqueName, or null if not found.
parseFile({required String path, ResourceProvider? resourceProvider, required FeatureSet featureSet, bool throwIfDiagnostics = true}) → ParseStringResult
Return the result of parsing the file at the given path.
parseString({required String content, FeatureSet? featureSet, String? path, bool throwIfDiagnostics = true}) → ParseStringResult
Returns the result of parsing the given content as a compilation unit.
resolveFile({required String path, ResourceProvider? resourceProvider}) Future<SomeResolvedUnitResult>
Return the result of resolving the file at the given path.
resolveFile2({required String path, ResourceProvider? resourceProvider}) Future<SomeResolvedUnitResult>
Return the result of resolving the file at the given path.

Typedefs

AnalysisError = Diagnostic
A deprecated name for Diagnostic. Please use Diagnostic.
AnalyzerFile = File
AnalyzerFolder = Folder
ErrorCode = DiagnosticCode
A diagnostic code associated with an AnalysisError.
ErrorSeverity = DiagnosticSeverity
The severity of a DiagnosticCode.
ErrorType = DiagnosticType
SessionedRuleFactory<C extends ContextConfig> = SessionManagedAnalysisRule<C> Function(SessionDataManager)
A factory function that creates a SessionManagedAnalysisRule from a shared SessionDataManager.