candies_analyzer_plugin library

Classes

AnalysisErrorInfo
The analysis errors and line information for the errors.
Analyzer
Facade for managing access to analyzer package APIs.
BeginToken
The opening half of a grouping pair of tokens. This is used for curly brackets ('{'), parentheses ('('), and square brackets ('[').
CamelCaseString
CandiesAnalyzerPlugin
CandiesAnalyzerPluginConfig
The class to handle pubspec.yaml and analysis_options.yaml
CandiesAnalyzerPluginIgnoreInfo
The class to help ignore error
CandiesAnalyzerPluginLogger
The logger for this plugin
CandiesAnalyzerPluginStarter
An object that can be used to start an analysis server plugin. This class exists so that clients can configure a plugin before starting it.
CandiesLintsAstVisitor
The default AstVisitor to analyze lints
CandyLint
The lint base
CollectionStyle
An enum of collection styles.
CommentToken
A token representing a comment.
DartAnalysisError
The cache error for get fixes
DartLint
The dart lint base
DartLinter
Dart source linter.
Dependency
DocumentationCommentToken
A documentation comment token.
EndCallSuperDispose
ErrorWatchingSink
ExitDetector
Instances of the class ExitDetector determine whether the visited AST node is guaranteed to terminate by executing a return statement, throw expression, rethrow expression, or simple infinite loop such as while(true).
GenericAnalysisError
The cache error for get fixes
GenericLint
The generic lint base
GitDependency
Group
HostedDependency
HostedDetails
InheritanceManager3
Manages knowledge about interface types and their members.
KeywordToken
A token representing a keyword in the language.
LineInfo
Information about line and column information within a source file.
LintCode
Defines style and best practice recommendations.
LinterContext
Provides access to information needed by lint rules that is not available from AST nodes or the element model.
LinterOptions
Linter options.
LintFilter
Filtered lints are omitted from linter output.
LintRule
Describes a lint rule.
Maturity
MustCallSuperDispose
Name
A public name, or a private name qualified by a library URI.
NodeLintRegistry
The container to register visitors for separate AST node types.
NodeLintRule
LintRules that implement this interface want to process only some types of AST nodes, and will register their processors in the registry.
PathDependency
PerferClassPrefix
The 'perfer_class_prefix' lint
PerferDocComments
The 'perfer_doc_comments' lint https://dart.dev/guides/language/effective-dart/documentation The same like public_member_api_docs but we can ignore lint or ignore file by override ignoreLint and ignoreFile and you can override isPrivate and inPrivateMember to filter lint
PerferSafeSetState
The 'prefer_safe_setState' lint
PreferAssetConst
The 'prefer_asset_const' lint
PreferNamedRoutes
The 'prefer_named_routes' lint
PreferSingleton
PSEntry
Pubspec
PubspecVisitor<T>
PubWorkspacePackage
Information about a package defined in a PubWorkspace.
ScalarStyle
An enum of source scalar styles.
Screenshot
SdkDependency
SecurityLintCode
Defines security-related best practice recommendations.
SimpleToken
A token that was scanned from the input. Each token knows which tokens precede and follow it, acting as a link in a doubly linked list of tokens.
Source
The interface Source defines the behavior of objects representing source code that can be analyzed by the analysis engine.
Spelunker
StringToken
A token whose value is independent of it's type.
SyntheticBeginToken
A synthetic begin token.
SyntheticKeywordToken
A synthetic keyword token.
SyntheticStringToken
A token whose value is independent of it's type.
SyntheticToken
A synthetic token.
TagDirective
A directive describing a custom tag handle.
TokenClass
The classes (or groups) of tokens with a similar use.
TypeSystem
A representation of the operations defined for the type system.
UnusedFile
https://github.com/dart-lang/sdk/blob/master/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart#L267 The 'unused_file' lint
VersionDirective
A directive indicating which version of YAML a document was written to.
YamlAnalysisError
The cache error for get fixes
YamlDocument
A YAML document, complete with metadata.
YamlLint
The yaml lint base
YamlList
A read-only List parsed from YAML.
YamlMap
A read-only Map parsed from YAML.
YamlNode
An interface for parsed nodes from a YAML source tree.
YamlScalar
A wrapped scalar value parsed from YAML.

Mixins

AnalyzeErrorAfterFilesAnalyzed
AstVisitorBase
AstVisitor to check lint
CallSuperDisposeMixin
CandiesAnalyzerPluginBase
Put properties or methods not from ServerPlugin here.

Extensions

AnalysisContextE on AnalysisContext
The extension for AnalysisContext
DartFileEditBuilderE on DartFileEditBuilder
The extension for DartFileEditBuilder
ElementExtension on Element?
ErrorProcessorE on ErrorProcessor
LibraryElementE on LibraryElement
ResolvedUnitResultE on ResolvedUnitResult
The extension for ResolvedUnitResult

Constants

loggedAnalyzerErrorExitCode → const int

Properties

lintRegistry ↔ LintRegistry
Shared lint registry.
getter/setter pair
reservedWords List<String>
final
yamlWarningCallback YamlWarningCallback
A callback for emitting a warning.
getter/setter pair

Functions

createLibraryNamePrefix({required String libraryPath, String? projectRoot, String? packageName}) String
Create a library name prefix based on libraryPath, projectRoot and current packageName.
getChildren(Element parent, [String? name]) List<Element>
Returns direct children of parent.
getCompilationUnit(AstNode node) → CompilationUnit?
Return the compilation unit of a node
getFieldName(FieldDeclaration decl, String name) → Token?
Returns a field identifier with the given name in the given decl's variable declaration list or null if none is found.
getIntValue(Expression expression, LinterContext? context) int?
Returns the value of an IntegerLiteral or PrefixExpression with a minus and then an IntegerLiteral. If a context is provided, SimpleIdentifiers are evaluated as constants. For anything else, returns null.
getNodeToAnnotate(Declaration node) → SyntacticEntity
Returns the most specific AST node appropriate for associating errors.
getWriteOrReadElement(SimpleIdentifier node) → Element?
If the node is the finishing identifier of an assignment, return its "writeElement", otherwise return its "staticElement", which might be thought as the "readElement".
hasConstantError(LinterContext context, Expression node) bool
hasLeadingUnderscore(String name) bool
Returns true if the given name has a leading _.
hasLiteralAnnotation(Element element) bool
Returns true if this element has a @literal annotation.
hasOverrideAnnotation(Element element) bool
Returns true if this element has an @override annotation.
inPrivateMember(AstNode node) bool
Returns true if this node is the child of a private compilation unit member.
isCamelCase(String string) bool
Check if this string is formatted in CamelCase.
isDartFileName(String fileName) bool
Returns true if this fileName is a Dart file.
isEquals(ClassMember element) bool
Returns true if this element is the == method declaration.
isFinalOrConst(Token token) bool
Returns true if the keyword associated with this token is final or const.
isHashCode(ClassMember element) bool
Returns true if this element is a hashCode method or field declaration.
isIdentifier(String name) bool
Returns true if this name is a legal Dart identifier.
isIndex(ClassMember element) bool
Returns true if this element is an index method or field declaration.
isInLibDir(CompilationUnit node, WorkspacePackage? package) bool
Return true if this compilation unit node is declared within the given package's lib/ directory tree.
isInPublicDir(CompilationUnit node, WorkspacePackage? package) bool
Return true if this compilation unit node is declared within a public directory in the given package's directory tree. Public dirs are the lib and bin dirs.
isKeyword(Token token, Keyword keyword) bool
Returns true if the keyword associated with the given token matches keyword.
isKeyWord(String id) bool
Returns true if the given id is a Dart keyword.
isLowerCamelCase(String id) bool
Returns true if this id is lowerCamelCase.
isLowerCaseUnderScore(String id) bool
Returns true if this id is lower_camel_case_with_underscores.
isLowerCaseUnderScoreWithDots(String id) bool
Returns true if this id is lower_camel_case_with_underscores_or.dots.
isMethod(ClassMember m) bool
Returns true if the given ClassMember is a method.
isPrivate(Token? name) bool
Check if the given identifier has a private name.
isPublicMethod(ClassMember m) bool
Returns true if the given ClassMember is a public method.
isPubspecFileName(String fileName) bool
Returns true if this fileName is a Pubspec file.
isReservedWord(String word) bool
Check if the given word is a Dart reserved word.
isSimpleGetter(MethodDeclaration declaration) bool
Returns true if the given method declaration is a "simple getter".
isSimpleSetter(MethodDeclaration setter) bool
Returns true if the given setter is a "simple setter".
isUpperCase(int c) bool
Returns true if the given code unit c is upper case.
isValidDartIdentifier(String id) bool
Returns true if the given id is a valid Dart identifier.
isValidLibraryPrefix(String libraryPrefix) bool
Returns true if this libraryPrefix is valid.
isValidPackageName(String id) bool
Returns true if this id is a valid package name.
isValues(ClassMember element) bool
Returns true if this element is a values method or field declaration.
isVar(Token token) bool
Returns true if the keyword associated with this token is var.
lintFiles(DartLinter linter, List<File> filesToLint) Future<Iterable<AnalysisErrorInfo>>
loadYaml(String yaml, {Uri? sourceUrl, bool recover = false, ErrorListener? errorListener}) → dynamic
Loads a single document from a YAML string.
loadYamlDocument(String yaml, {Uri? sourceUrl, bool recover = false, ErrorListener? errorListener}) YamlDocument
Loads a single document from a YAML string as a YamlDocument.
loadYamlDocuments(String yaml, {Uri? sourceUrl}) List<YamlDocument>
Loads a stream of documents from a YAML string.
loadYamlNode(String yaml, {Uri? sourceUrl, bool recover = false, ErrorListener? errorListener}) YamlNode
Loads a single document from a YAML string as a YamlNode.
loadYamlStream(String yaml, {Uri? sourceUrl}) YamlList
Loads a stream of documents from a YAML string.
locatePubspecFile(CompilationUnit compilationUnit) → File?
Return the nearest enclosing pubspec file.
visitChildren(Element element, ElementProcessor processor) → void
Uses processor to visit all of the children of element. If processor returns true, then children of a child are visited too.

Typedefs

ElementProcessor = bool Function(Element element)
An Element processor function type. If true is returned, children of element will be visited.
YamlWarningCallback = void Function(String message, [SourceSpan? span])
A callback for emitting a warning.

Exceptions / Errors

YamlException
An error thrown by the YAML processor.