Trait stc_ts_file_analyzer::validator::Validate
source · [−]pub trait Validate<'context, T: ?Sized>where
T: RNode,{
type Output;
type Context: 'context + Copy;
fn validate(&mut self, node: &T, ctxt: Self::Context) -> Self::Output;
}
Expand description
Visit with output
Required Associated Types
Required Methods
Implementors
sourceimpl<'c, T, V, O, E> Validate<'c, Vec<T, Global>> for Vwhere
Self: Validate<'c, T, Output = Result<O, E>>,
T: ValidateInDeclOrder,
Vec<T>: RNode,
impl<'c, T, V, O, E> Validate<'c, Vec<T, Global>> for Vwhere
Self: Validate<'c, T, Output = Result<O, E>>,
T: ValidateInDeclOrder,
Vec<T>: RNode,
sourceimpl<'context> Validate<'context, RClassMember> for Analyzer<'_, '_>
impl<'context> Validate<'context, RClassMember> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RExpr> for Analyzer<'_, '_>
type Context = (TypeOfMode, Option<&'context TypeParamInstantiation>, Option<&'context Type>)
type Output = Result<Type, Error>
sourceimpl<'context> Validate<'context, RJSXAttrValue> for Analyzer<'_, '_>
impl<'context> Validate<'context, RJSXAttrValue> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RJSXElementChild> for Analyzer<'_, '_>
impl<'context> Validate<'context, RJSXElementChild> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RJSXElementName> for Analyzer<'_, '_>
impl<'context> Validate<'context, RJSXElementName> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RJSXObject> for Analyzer<'_, '_>
impl<'context> Validate<'context, RJSXObject> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RModuleItem> for Analyzer<'_, '_>
impl<'context> Validate<'context, RModuleItem> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RParamOrTsParamProp> for Analyzer<'_, '_>
impl<'context> Validate<'context, RParamOrTsParamProp> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsFnParam> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsFnParam> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypeElement> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeElement> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypeQueryExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeQueryExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RArrayLit> for Analyzer<'_, '_>
impl<'context> Validate<'context, RArrayLit> for Analyzer<'_, '_>
type Context = (TypeOfMode, Option<&'context TypeParamInstantiation>, Option<&'context Type>)
type Output = Result<Type, Error>
sourceimpl<'context> Validate<'context, RArrowExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RArrowExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RAssignExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RAssignExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RAssignPat> for Analyzer<'_, '_>
impl<'context> Validate<'context, RAssignPat> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RAwaitExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RAwaitExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RBlockStmt> for Analyzer<'_, '_>
impl<'context> Validate<'context, RBlockStmt> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RCatchClause> for Analyzer<'_, '_>
impl<'context> Validate<'context, RCatchClause> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RClass> for Analyzer<'_, '_>
impl<'context> Validate<'context, RClass> for Analyzer<'_, '_>
Order:
- static properties
- static methods, using dependency graph.
- TsParamProp in constructors.
- Properties from top to bottom.
- Others, using dependency graph.
sourceimpl<'context> Validate<'context, RClassDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RClassDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RClassExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RClassExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RClassMethod> for Analyzer<'_, '_>
impl<'context> Validate<'context, RClassMethod> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RClassProp> for Analyzer<'_, '_>
impl<'context> Validate<'context, RClassProp> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RComputedPropName> for Analyzer<'_, '_>
impl<'context> Validate<'context, RComputedPropName> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RConstructor> for Analyzer<'_, '_>
impl<'context> Validate<'context, RConstructor> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RDecorator> for Analyzer<'_, '_>
impl<'context> Validate<'context, RDecorator> for Analyzer<'_, '_>
Done
sourceimpl<'context> Validate<'context, RDoWhileStmt> for Analyzer<'_, '_>
impl<'context> Validate<'context, RDoWhileStmt> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RExportAll> for Analyzer<'_, '_>
impl<'context> Validate<'context, RExportAll> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RExportDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RExportDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RExportDefaultDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RExportDefaultDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RExportDefaultExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RExportDefaultExpr> for Analyzer<'_, '_>
Done
sourceimpl<'context> Validate<'context, RExportNamedSpecifier> for Analyzer<'_, '_>
impl<'context> Validate<'context, RExportNamedSpecifier> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RExprOrSpread> for Analyzer<'_, '_>
impl<'context> Validate<'context, RExprOrSpread> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RForInStmt> for Analyzer<'_, '_>
impl<'context> Validate<'context, RForInStmt> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RForOfStmt> for Analyzer<'_, '_>
impl<'context> Validate<'context, RForOfStmt> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RGetterProp> for Analyzer<'_, '_>
impl<'context> Validate<'context, RGetterProp> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RIdent> for Analyzer<'_, '_>
impl<'context> Validate<'context, RIdent> for Analyzer<'_, '_>
type Context = (TypeOfMode, Option<&'context TypeParamInstantiation>, Option<&'context Type>)
type Output = Result<Type, Error>
sourceimpl<'context> Validate<'context, RImportDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RImportDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RJSXElement> for Analyzer<'_, '_>
impl<'context> Validate<'context, RJSXElement> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RJSXExprContainer> for Analyzer<'_, '_>
impl<'context> Validate<'context, RJSXExprContainer> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RJSXFragment> for Analyzer<'_, '_>
impl<'context> Validate<'context, RJSXFragment> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RJSXMemberExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RJSXMemberExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RJSXNamespacedName> for Analyzer<'_, '_>
impl<'context> Validate<'context, RJSXNamespacedName> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RJSXSpreadChild> for Analyzer<'_, '_>
impl<'context> Validate<'context, RJSXSpreadChild> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RMetaPropExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RMetaPropExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RNamedExport> for Analyzer<'_, '_>
impl<'context> Validate<'context, RNamedExport> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RObjectLit> for Analyzer<'_, '_>
impl<'context> Validate<'context, RObjectLit> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, ROptChainExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, ROptChainExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RParenExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RParenExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RPrivateMethod> for Analyzer<'_, '_>
impl<'context> Validate<'context, RPrivateMethod> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RPrivateName> for Analyzer<'_, '_>
impl<'context> Validate<'context, RPrivateName> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RPrivateProp> for Analyzer<'_, '_>
impl<'context> Validate<'context, RPrivateProp> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RReturnStmt> for Analyzer<'_, '_>
impl<'context> Validate<'context, RReturnStmt> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RStaticBlock> for Analyzer<'_, '_>
impl<'context> Validate<'context, RStaticBlock> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RSwitchStmt> for Analyzer<'_, '_>
impl<'context> Validate<'context, RSwitchStmt> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTaggedTpl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTaggedTpl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsArrayType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsArrayType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsAsExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsAsExpr> for Analyzer<'_, '_>
type Context = (TypeOfMode, Option<&'context TypeParamInstantiation>, Option<&'context Type>)
type Output = Result<Type, Error>
sourceimpl<'context> Validate<'context, RTsCallSignatureDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsCallSignatureDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsConditionalType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsConditionalType> for Analyzer<'_, '_>
Order of evaluation is important to handle infer types correctly.
sourceimpl<'context> Validate<'context, RTsConstAssertion> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsConstAssertion> for Analyzer<'_, '_>
type Context = (TypeOfMode, Option<&'context TypeParamInstantiation>, Option<&'context Type>)
type Output = Result<Type, Error>
sourceimpl<'context> Validate<'context, RTsConstructSignatureDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsConstructSignatureDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsConstructorType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsConstructorType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsEnumDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsEnumDecl> for Analyzer<'_, '_>
We don’t visit enum variants to allow
const enum E {
a = 10,
b = a,
c = (a+1),
e,
d = ~e,
f = a << 2 >> 1,
g = a << 2 >>> 1,
h = a | b
}
sourceimpl<'context> Validate<'context, RTsExportAssignment> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsExportAssignment> for Analyzer<'_, '_>
Done
sourceimpl<'context> Validate<'context, RTsExprWithTypeArgs> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsExprWithTypeArgs> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsGetterSignature> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsGetterSignature> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsImportEqualsDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsImportEqualsDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsImportType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsImportType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsIndexSignature> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsIndexSignature> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsIndexedAccessType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsIndexedAccessType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsInferType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsInferType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsInstantiation> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsInstantiation> for Analyzer<'_, '_>
type Context = (TypeOfMode, Option<&'context TypeParamInstantiation>, Option<&'context Type>)
type Output = Result<Type, Error>
sourceimpl<'context> Validate<'context, RTsInterfaceBody> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsInterfaceBody> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsInterfaceDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsInterfaceDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsIntersectionType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsIntersectionType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsMappedType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsMappedType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsMethodSignature> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsMethodSignature> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsModuleBlock> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsModuleBlock> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsModuleDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsModuleDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsNamespaceDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsNamespaceDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsOptionalType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsOptionalType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsParamProp> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsParamProp> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsParenthesizedType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsParenthesizedType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsPropertySignature> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsPropertySignature> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsRestType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsRestType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsSatisfiesExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsSatisfiesExpr> for Analyzer<'_, '_>
type Context = (TypeOfMode, Option<&'context TypeParamInstantiation>, Option<&'context Type>)
type Output = Result<Type, Error>
sourceimpl<'context> Validate<'context, RTsSetterSignature> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsSetterSignature> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTplLitType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTplLitType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTupleElement> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTupleElement> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTupleType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTupleType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypeAliasDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeAliasDecl> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypeAnn> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeAnn> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypeAssertion> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeAssertion> for Analyzer<'_, '_>
type Context = (TypeOfMode, Option<&'context TypeParamInstantiation>, Option<&'context Type>)
type Output = Result<Type, Error>
sourceimpl<'context> Validate<'context, RTsTypeLit> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeLit> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypeOperator> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeOperator> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypeParam> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeParam> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypeParamDecl> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeParamDecl> for Analyzer<'_, '_>
We analyze dependencies between type parameters, and fold parameter in topological order.
sourceimpl<'context> Validate<'context, RTsTypeParamInstantiation> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeParamInstantiation> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypePredicate> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypePredicate> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypeQuery> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeQuery> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsTypeRef> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsTypeRef> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RTsUnionType> for Analyzer<'_, '_>
impl<'context> Validate<'context, RTsUnionType> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RUnaryExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RUnaryExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RUpdateExpr> for Analyzer<'_, '_>
impl<'context> Validate<'context, RUpdateExpr> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RVarDeclarator> for Analyzer<'_, '_>
impl<'context> Validate<'context, RVarDeclarator> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RWhileStmt> for Analyzer<'_, '_>
impl<'context> Validate<'context, RWhileStmt> for Analyzer<'_, '_>
sourceimpl<'context> Validate<'context, RWithStmt> for Analyzer<'_, '_>
impl<'context> Validate<'context, RWithStmt> for Analyzer<'_, '_>
NOTE: We does not dig into with statements.