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
feat: resolve stdlib call: attribute placeholders via CDN registry (#618)
* feat: resolve call: attribute placeholders via stdlib/thirdparty registry
When ResolveAttributePlaceholders encounters a call: placeholder like
'call:sqlite3.connect' that doesn't match a project function, it now
falls back to checking the stdlib and third-party CDN registries for
the function's return type or constructor. This resolves attribute types
for stdlib calls (e.g., sqlite3.connect → sqlite3.Connection) and
constructors (e.g., configparser.ConfigParser), enabling deep chain
resolution through stdlib intermediate types.
Project ReturnTypes lookup still takes priority over stdlib fallback.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: 100% coverage for call: placeholder stdlib/thirdparty resolution
Edge case tests for resolveCallPlaceholderViaRegistry and tryRegistryLookup:
- nil typeEngine safety
- single-part funcName (no dots) skipped
- unknown/empty return type skipped
- stdlib checked before thirdparty (ordering guarantee)
- thirdparty constructor fallback
- unknown module stays unresolved
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: extract dotted call types and use silentLogger for stdlib resolution
Three fixes to complete the stdlib attribute type propagation:
1. extraction/attributes.go: Handle attribute nodes (dotted calls like
sqlite3.connect) in inferFromFunctionCall, not just identifiers. This
creates call:sqlite3.connect placeholders for self.conn = sqlite3.connect().
2. resolution/attribute.go: Use a silentLogger (io.Discard writer) for
stdlib/thirdparty registry lookups instead of nil, preventing panic
when modules need to be lazy-loaded from CDN during attribute resolution.
3. registry/{stdlib,thirdparty}_remote.go: Add GetCachedModule() method
for cache-only lookups without CDN downloads.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: 100% coverage for call: placeholder stdlib/thirdparty resolution
Cover all lines flagged by Codecov:
- extraction/attributes.go: dotted call extraction (sqlite3.connect)
- registry/stdlib_remote.go: GetCachedModule
- registry/thirdparty_remote.go: GetCachedModule
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments