pub struct MemberInfo {
pub name: String,
pub kind: MemberKind,
pub span: Span,
pub has_decorator: bool,
pub decorator_names: Vec<String>,
pub is_instance_returning_static: bool,
pub is_self_returning: bool,
pub override_base: Option<String>,
pub is_protected: bool,
pub is_static: bool,
}Expand description
A member of an enum, class, or namespace.
Fields§
§name: StringMember name.
kind: MemberKindThe kind of member (enum, class method/property, or namespace member).
span: SpanSource span of the member declaration.
has_decorator: boolWhether this member has decorators (e.g., @Column(), @Inject()).
Decorated members are used by frameworks at runtime and should not be
flagged as unused class members, unless every decorator on the member
is opted out via FallowConfig.ignore_decorators.
decorator_names: Vec<String>Full dotted path of each decorator on this member, in source order.
@step("x") stores "step"; @ns.foo stores "ns.foo". Empty for
undecorated members, Angular signal-initializer properties (which set
has_decorator without a literal decorator AST node), and decorators
whose expression is not an identifier ladder (the entry is the empty
string in that case, treated as never-matching by the predicate).
is_instance_returning_static: boolTrue for a static method that returns a new instance of its class
(return new this(), return new C(), or a declared return type C).
Member accesses on the call result credit the class (#346, #387).
is_self_returning: boolTrue when this is an instance class method whose call result is an
instance of the same class. Qualifies when the declared return type
matches the class name (setX(): EventBuilder { ... }) or when the
body’s last statement is return this. The analyze layer walks fluent
chains (Class.factory().setX().setY()) only through methods carrying
this flag, so the chain stops at a non-self-returning method like
.build(). See issue #387.
override_base: Option<String>Root identifier of the class extends expression, set only when the
member has the override modifier: Container in
extends Container<Env>, Schema in extends Schema.TaggedError<E>()(...).
The analysis credits the member when this root names code outside the
project, because that code calls the overridden member.
is_protected: boolTrue for a class member with the TypeScript protected modifier. Only
the unused-protected-class-members rule checks these members. Every
other consumer that checks class members skips them.
is_static: boolTrue for a static class member, which code with the class value reads.