Cleanup
This commit is contained in:
@@ -1231,6 +1231,7 @@ match 1:
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn if_statement() {
|
||||
let TestCase { db, file } = test_case(
|
||||
"
|
||||
|
||||
@@ -14,7 +14,6 @@ use ruff_python_ast::{AnyParameterRef, BoolOp, Expr};
|
||||
use crate::ast_node_ref::AstNodeRef;
|
||||
use crate::semantic_index::ast_ids::node_key::ExpressionNodeKey;
|
||||
use crate::semantic_index::ast_ids::AstIdsBuilder;
|
||||
use crate::semantic_index::constraint::ConstraintKind;
|
||||
use crate::semantic_index::definition::{
|
||||
AssignmentDefinitionNodeRef, ComprehensionDefinitionNodeRef, Definition, DefinitionNodeKey,
|
||||
DefinitionNodeRef, ForStmtDefinitionNodeRef, ImportFromDefinitionNodeRef,
|
||||
@@ -239,9 +238,6 @@ impl<'db> SemanticIndexBuilder<'db> {
|
||||
// SAFETY: `definition_node` is guaranteed to be a child of `self.module`
|
||||
let kind = unsafe { definition_node.into_owned(self.module.clone()) };
|
||||
let category = kind.category();
|
||||
|
||||
// let constraints = self.current_use_def_map().
|
||||
|
||||
let definition = Definition::new(
|
||||
self.db,
|
||||
self.file,
|
||||
@@ -249,7 +245,6 @@ impl<'db> SemanticIndexBuilder<'db> {
|
||||
symbol,
|
||||
kind,
|
||||
countme::Count::default(),
|
||||
vec![],
|
||||
);
|
||||
|
||||
let existing_definition = self
|
||||
@@ -294,7 +289,6 @@ impl<'db> SemanticIndexBuilder<'db> {
|
||||
let expression = self.add_standalone_expression(constraint_node);
|
||||
Constraint {
|
||||
node: ConstraintNode::Expression(expression),
|
||||
kind: ConstraintKind::Narrowing,
|
||||
is_positive: true,
|
||||
}
|
||||
}
|
||||
@@ -303,7 +297,6 @@ impl<'db> SemanticIndexBuilder<'db> {
|
||||
self.current_use_def_map_mut()
|
||||
.record_constraint(Constraint {
|
||||
node: constraint.node,
|
||||
kind: constraint.kind,
|
||||
is_positive: false,
|
||||
});
|
||||
}
|
||||
@@ -348,7 +341,6 @@ impl<'db> SemanticIndexBuilder<'db> {
|
||||
self.current_use_def_map_mut()
|
||||
.record_constraint(Constraint {
|
||||
node: ConstraintNode::Pattern(pattern_constraint),
|
||||
kind: ConstraintKind::Narrowing,
|
||||
is_positive: true,
|
||||
});
|
||||
pattern_constraint
|
||||
|
||||
@@ -6,15 +6,9 @@ use crate::db::Db;
|
||||
use crate::semantic_index::expression::Expression;
|
||||
use crate::semantic_index::symbol::{FileScopeId, ScopeId};
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub(crate) enum ConstraintKind {
|
||||
Narrowing,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub(crate) struct Constraint<'db> {
|
||||
pub(crate) node: ConstraintNode<'db>,
|
||||
pub(crate) kind: ConstraintKind,
|
||||
pub(crate) is_positive: bool,
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ use crate::ast_node_ref::AstNodeRef;
|
||||
use crate::module_resolver::file_to_module;
|
||||
use crate::node_key::NodeKey;
|
||||
use crate::semantic_index::symbol::{FileScopeId, ScopeId, ScopedSymbolId};
|
||||
use crate::semantic_index::Expression;
|
||||
use crate::unpack::Unpack;
|
||||
use crate::Db;
|
||||
|
||||
@@ -24,7 +23,7 @@ use crate::Db;
|
||||
/// * a field of a type that is a return type of a cross-module query
|
||||
/// * an argument of a cross-module query
|
||||
#[salsa::tracked]
|
||||
pub(crate) struct Definition<'db> {
|
||||
pub struct Definition<'db> {
|
||||
/// The file in which the definition occurs.
|
||||
#[id]
|
||||
pub(crate) file: File,
|
||||
@@ -43,8 +42,6 @@ pub(crate) struct Definition<'db> {
|
||||
|
||||
#[no_eq]
|
||||
count: countme::Count<Definition<'static>>,
|
||||
|
||||
constraints: Vec<Expression<'db>>,
|
||||
}
|
||||
|
||||
impl<'db> Definition<'db> {
|
||||
|
||||
Reference in New Issue
Block a user