Avoid the need to import search_ancestor

This commit is contained in:
Dave Halter
2026-01-19 20:30:03 +01:00
parent 4a7b5f4879
commit 3ac1632a5c
13 changed files with 28 additions and 44 deletions
+1 -1
View File
@@ -483,7 +483,7 @@ class Script:
module_context = self._get_module_context()
n = tree.search_ancestor(leaf, 'funcdef', 'classdef')
n = leaf.search_ancestor('funcdef', 'classdef')
if n is not None and n.start_pos < pos <= n.children[-1].start_pos:
# This is a bit of a special case. The context of a function/class
# name/param/keyword is always it's parent context, not the