mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-07 17:10:31 +00:00
[ty] Support declaration-only attributes (#19048)
## Summary Following ty issue [#698](https://github.com/astral-sh/ty/issues/698) this PR adds support for declarations. closes #698 ## Test Plan Tested against mdtest (specifically attributes). --------- Co-authored-by: David Peter <mail@david-peter.de>
This commit is contained in:
parent
b6edfbc70f
commit
e0b7f496f2
4 changed files with 90 additions and 16 deletions
|
@ -509,6 +509,18 @@ impl<'db> UseDefMap<'db> {
|
|||
.is_always_false()
|
||||
}
|
||||
|
||||
pub(crate) fn is_declaration_reachable(
|
||||
&self,
|
||||
db: &dyn crate::Db,
|
||||
declaration: &DeclarationWithConstraint<'db>,
|
||||
) -> Truthiness {
|
||||
self.reachability_constraints.evaluate(
|
||||
db,
|
||||
&self.predicates,
|
||||
declaration.reachability_constraint,
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn is_binding_reachable(
|
||||
&self,
|
||||
db: &dyn crate::Db,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue