[ty] Remove TODO about using a non-panicking lookup method

Ref https://github.com/astral-sh/ruff/pull/20439#discussion_r2355082049

Ref https://github.com/astral-sh/ruff/pull/18455#discussion_r2126833137
This commit is contained in:
Andrew Gallant 2025-09-17 11:46:42 -04:00 committed by Andrew Gallant
parent 64a4e2889e
commit 3fcbe8bde6

View file

@ -267,10 +267,6 @@ impl<'db> SemanticModel<'db> {
fn scope(&self, node: ast::AnyNodeRef<'_>) -> Option<FileScopeId> { fn scope(&self, node: ast::AnyNodeRef<'_>) -> Option<FileScopeId> {
let index = semantic_index(self.db, self.file); let index = semantic_index(self.db, self.file);
// TODO: We currently use `try_expression_scope_id` here as a hotfix for [1].
// Revert this to use `expression_scope_id` once a proper fix is in place.
//
// [1] https://github.com/astral-sh/ty/issues/572
match node { match node {
ast::AnyNodeRef::Identifier(identifier) => index.try_expression_scope_id(identifier), ast::AnyNodeRef::Identifier(identifier) => index.try_expression_scope_id(identifier),
node => match node.as_expr_ref() { node => match node.as_expr_ref() {