mirror of https://github.com/astral-sh/ruff
doc comments for AttributeState
This commit is contained in:
parent
5ad159178e
commit
f247c39cd8
|
|
@ -909,8 +909,24 @@ pub enum CallChainLayout {
|
||||||
/// element relative to the first call or subscript.
|
/// element relative to the first call or subscript.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum AttributeState {
|
pub enum AttributeState {
|
||||||
|
/// Stores the number of calls or subscripts on attributes
|
||||||
|
/// to the left of the current position in a chain.
|
||||||
|
///
|
||||||
|
/// Consecutive calls/subscripts on a single
|
||||||
|
/// object only count once. For example, if we are at
|
||||||
|
/// `c` in `a.b()[0]()().c()` then this number would be 1.
|
||||||
CallsOrSubscriptsPreceding(u32),
|
CallsOrSubscriptsPreceding(u32),
|
||||||
|
/// Indicates that we are at the first called or
|
||||||
|
/// subscripted attribute in the chain (and should
|
||||||
|
/// therefore break).
|
||||||
|
///
|
||||||
|
/// For example, if we are at `b` in `a.b()[0]()().c()`
|
||||||
FirstCallOrSubscript,
|
FirstCallOrSubscript,
|
||||||
|
/// Indicates that we are to the left of the first
|
||||||
|
/// called or subscripted attribute, and therefore
|
||||||
|
/// need not break.
|
||||||
|
///
|
||||||
|
/// For example, if we are at `a` in `a.b()[0]()().c()`
|
||||||
BeforeFirstCallOrSubscript,
|
BeforeFirstCallOrSubscript,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -964,7 +980,7 @@ impl CallChainLayout {
|
||||||
comment_ranges: &CommentRanges,
|
comment_ranges: &CommentRanges,
|
||||||
source: &str,
|
source: &str,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
// Count of attribute values which are called or
|
// Count of attribute _values_ which are called or
|
||||||
// subscripted, after the leftmost parenthesized
|
// subscripted, after the leftmost parenthesized
|
||||||
// value.
|
// value.
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue