You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
matchFuzzy resolves onto a nested function that matchByExactName had already rejected as lexically unreachable #1708
matchByExactName filters its candidates with isLexicallyReachable (#1230): a function node whose qualified name puts it inside another function is only a candidate for references from inside that container. matchFuzzy does not apply that filter. So when the only project symbol with a given (lower-cased) name is a nested function, exact-match correctly returns null, the ref falls through to fuzzy, and fuzzy adopts the nested function as its "unique" candidate at confidence 0.5.
Trigger: any common method name called on a receiver the extractor collapses to a bare name (res.text(), items.push(x), set.clear()), when some file in the repo happens to declare a closure with that name (const text = () => … inside a function, function push() {} inside buildRows).
11 fuzzy calls edges land on nested functions, 9 of them from a different file than the closure. Six calls named isOpen from various components resolve to useOverlayStack::isOpen, a closure inside a composable, because it is the only symbol with that name.
Same repo with #1679 (#1669, which extracts closures that were previously invisible, so many more nested functions exist to be hit):
fuzzy calls edges rise from 89 to 226. 160 of them land on nested functions, 139 cross-file: 72 .text() calls (Response#text, test-utils wrapper.text()) resolve to readSeedFailureState::text, 41 .push() calls to buildRows::push, 10 to captureListeners::event, 7 to resolveClosestName::fallback, 6 to startWarRoomBlankBoardHeal::clear.
So #1679 is not the bug, it just multiplies the targets; the gap is in matchFuzzy.
Measured on the same repo with that one change: 41,378 → 41,367 edges, fuzzy 26 → 15, fuzzy-onto-nested-function 11 → 0, nothing else moves. With #1679 applied it should take the 160 closure hits back out the same way (not measured). PR to follow with a test (two files, a closure named text in one, a res.text() call in the other, assert no calls edge).
Reproduce (pre-fix main):matchFuzzy adopted a sole unreachable nested function (build::resolve) as a unique candidate at confidence 0.5 when called from another file.
Activity
colbymchenry commentedon Sep 8, 2026
Fixed by landing #1718 on main (
90dcdbc).Verified on Linux:
matchFuzzyadopted a sole unreachable nested function (build::resolve) as a unique candidate at confidence 0.5 when called from another file.isLexicallyReachableinmatchFuzzy(does not filter the candidate set — avoids fix(resolution): fuzzy matching skips a nested function the reference cannot reach #1709’s “crowd → one survivor” manufacture), plus C/C++NO_NESTED_FUNCTIONSso extraction nesting is never treated as a scope.__tests__/fuzzy-lexical-reach.test.ts6/6;__tests__/resolution.test.ts198/198 earlier on the merged tip.No follow-up PR needed — upstream #1718 was the right shape.
Merge origin/main (8733c28) into fork/consolidated