diff --git a/crates/red_knot_python_semantic/src/node_key.rs b/crates/red_knot_python_semantic/src/node_key.rs index 363db31034a206..5395884f5a1285 100644 --- a/crates/red_knot_python_semantic/src/node_key.rs +++ b/crates/red_knot_python_semantic/src/node_key.rs @@ -5,7 +5,7 @@ use ruff_text_size::{Ranged, TextRange}; /// /// Compares two nodes by their kind and text range. #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)] -pub struct NodeKey { +pub(crate) struct NodeKey { kind: NodeKind, range: TextRange, } diff --git a/crates/red_knot_python_semantic/src/semantic_index/ast_ids.rs b/crates/red_knot_python_semantic/src/semantic_index/ast_ids.rs index 30106a9f461bfc..ec1edb3d8e0f39 100644 --- a/crates/red_knot_python_semantic/src/semantic_index/ast_ids.rs +++ b/crates/red_knot_python_semantic/src/semantic_index/ast_ids.rs @@ -191,13 +191,13 @@ impl AstIdsBuilder { } /// Node key that can only be constructed for expressions. -pub mod node_key { +pub(crate) mod node_key { use ruff_python_ast as ast; use crate::node_key::NodeKey; #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] - pub struct ExpressionNodeKey(NodeKey); + pub(crate) struct ExpressionNodeKey(NodeKey); impl From> for ExpressionNodeKey { fn from(value: ast::ExpressionRef<'_>) -> Self { diff --git a/crates/red_knot_python_semantic/src/semantic_index/definition.rs b/crates/red_knot_python_semantic/src/semantic_index/definition.rs index 1e8b8de9e20d9a..76d91e26d0a02e 100644 --- a/crates/red_knot_python_semantic/src/semantic_index/definition.rs +++ b/crates/red_knot_python_semantic/src/semantic_index/definition.rs @@ -12,7 +12,7 @@ use crate::Db; pub struct Definition<'db> { /// The file in which the definition occurs. #[id] - pub file: File, + pub(crate) file: File, /// The scope in which the definition occurs. #[id] @@ -582,7 +582,7 @@ impl ExceptHandlerDefinitionKind { } #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] -pub struct DefinitionNodeKey(pub NodeKey); +pub(crate) struct DefinitionNodeKey(pub(crate) NodeKey); impl From<&ast::Alias> for DefinitionNodeKey { fn from(node: &ast::Alias) -> Self { diff --git a/crates/red_knot_python_semantic/src/types/infer.rs b/crates/red_knot_python_semantic/src/types/infer.rs index 368699c391d9ff..bc13f4f30adadc 100644 --- a/crates/red_knot_python_semantic/src/types/infer.rs +++ b/crates/red_knot_python_semantic/src/types/infer.rs @@ -92,7 +92,6 @@ fn infer_definition_types_cycle_recovery<'db>( if category.is_binding() { inference.bindings.insert(input, Type::Unknown); } - db.report_untracked_read(); // TODO we don't fill in expression types for the cycle-participant definitions, which can // later cause a panic when looking up an expression type. inference diff --git a/crates/red_knot_server/src/server.rs b/crates/red_knot_server/src/server.rs index 67fff15b366ffd..d9b1e96736a3a5 100644 --- a/crates/red_knot_server/src/server.rs +++ b/crates/red_knot_server/src/server.rs @@ -182,7 +182,6 @@ impl Server { let mut scheduler = schedule::Scheduler::new(&mut session, worker_threads, connection.make_sender()); - log_err_msg!("WELCOME TO RUFF LSP"); for msg in connection.incoming() { if connection.handle_shutdown(&msg)? { break; diff --git a/crates/red_knot_server/src/server/api/requests/definition.rs b/crates/red_knot_server/src/server/api/requests/definition.rs index 07b93a8e7ad058..e2c98972a942f0 100644 --- a/crates/red_knot_server/src/server/api/requests/definition.rs +++ b/crates/red_knot_server/src/server/api/requests/definition.rs @@ -34,15 +34,16 @@ impl BackgroundDocumentRequestHandler for GotoDefinitionHandler { match lookup_result { Some(DefLocation::Location { url, range }) => { let result = Location { uri: url, range }; - return Ok(Some(GotoDefinitionResponse::Array(vec![result]))); + Ok(Some(GotoDefinitionResponse::Array(vec![result]))) } Some(DefLocation::Todo { s }) => { log_err_msg!("GOT TODO: {}", s); + Ok(None) } None => { log_err_msg!("NOTHING FOUND"); + Ok(None) } } - Ok(None) } } diff --git a/crates/ruff_db/src/files.rs b/crates/ruff_db/src/files.rs index d3d3307485998c..6ee35036fb5210 100644 --- a/crates/ruff_db/src/files.rs +++ b/crates/ruff_db/src/files.rs @@ -370,7 +370,6 @@ impl File { pub fn try_url(&self, db: &dyn Db) -> url::Url { let p = self.path(db); - eprintln!("TRY_URL ON {:?}", p); match p { FilePath::System(s) => { url::Url::parse(&("file://".to_string() + &s.to_string())).unwrap()