mirror of
https://github.com/colbymchenry/codegraph.git
synced 2026-10-26 20:42:56 +08:00
fix(resolution): keep unknown Python import members unresolved (#2040)
Bisect identifies 5eaa6fed (#2034, #1820) as the first bad commit: its Python named-import fallback resolves task.delay() to the task function itself, hiding the queue effect in API steps. Require member resolution before returning a named Python import's target for attribute access.
Keep direct calls, callbacks, constructors, and known members working. Add absolute/relative aliased-import regression coverage without changing the existing steps assertions.
Validation: git bisect with preserved steps test, tsc and copy-assets at every step, CODEGRAPH_KERNEL=0 throughout bisect. 338 tests pass across ui-steps-api-servers, function-ref, rebuilt kernel-tsjs-parity, resolution, and ui-effects. Issue #1820 repro and tsc --noEmit pass.
This commit is contained in:
@@ -1725,6 +1725,13 @@ export function resolveViaImport(
|
||||
// constant edge below rather than fabricating a wrong one.
|
||||
const instanceMember = resolveImportedInstanceMember(targetNode, ref, imp.localName, context);
|
||||
if (instanceMember) return instanceMember;
|
||||
|
||||
// Finding a named Python import proves the receiver exists, not
|
||||
// its requested attribute. In particular, task.delay() enqueues
|
||||
// work; it does not call the imported task function directly.
|
||||
// Keep unknown members unresolved (including callback values)
|
||||
// instead of falling back to the receiver as their target.
|
||||
if (ref.language === 'python') return null;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user