Add native Python symbol resolution - #815
Open
jonathan343 wants to merge 4 commits into
Open
jonathan343 wants to merge 4 commits into
jonathan343 wants to merge 4 commits into
Conversation
jonathan343
added this pull request to stack #796
September 27, 2026 19:50
jonathan343
marked this pull request as ready for review
September 27, 2026 20:08
jonathan343
force-pushed
the
feat/codegen-symbols
branch
from
September 28, 2026 14:53
69dcc0a to
80f0eb4
Compare
kuhe
reviewed
Sep 28, 2026
| | __init__ | Init | init | INIT | | ||
| | class | Class | class_ | CLASS | | ||
| | None | None_ | none | NONE | | ||
| | match | Match | match | MATCH | |
Contributor
There was a problem hiding this comment.
these could be aligned using a markdown formatter for reading source mode
kuhe
reviewed
Sep 28, 2026
| "members": {"statusCode": {"target": "smithy.api#Integer"}} | ||
| } | ||
| } | ||
| }''') |
Contributor
There was a problem hiding this comment.
will dynamic client generation be from this loaded model?
kuhe
reviewed
Sep 28, 2026
| nullable: bool = False | ||
|
|
||
|
|
||
| _PRIMITIVES = { |
Contributor
There was a problem hiding this comment.
primitive in what sense?
some of these are not fixed-length data, like string, int, big numbers, document.
if this is the set of smithy simple types, it should be called that instead.
Contributor
There was a problem hiding this comment.
maybe _FIXED_TYPES? not the smithy simple set, but types that have a non-composite/generic python representation
Map selected Smithy shapes to Python names and immutable type references. Apply service renames, detect normalized-name collisions, and resolve recursive types without recursive traversal.
Match Smithy identifier rules for shape names, members, and namespace segments. Keep rejecting names that start with a digit or contain only underscores.
Explain naming and type references with concrete examples. Cover valid underscore-prefixed numeric names in symbol tests.
jonathan343
force-pushed
the
feat/codegen-symbols
branch
from
September 29, 2026 00:40
80f0eb4 to
5319bd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Stacked on #814, targeting
feat/codegen-selection-arenaso this PR contains only the symbol-provider work and a small identifier-parser fix.Summary
Adds
SymbolProviderto turn selected Smithy shapes into Python declaration names, field/constant names, and immutable type references. It applies service renames, preserves acronyms, reports naming collisions, and handles recursive types and sparse collections. Enum values resolve tostr/intto allow future service values.Also fixes the loader rejecting valid identifiers such as
_2HTTPServer, verified against Smithy CLI. The API and examples are indesigns/codegen/symbols.md.Example
Given a loaded
modeland itsselection, with anHTTPResponsestructure containing astatusCodeinteger field:Additional Testing
All 434 models in
aws/api-models-awspassed independent checks of names, type references, nested arguments, module identity, and sparse nullability: 119,324 type references and 232,207 field targets checked. The 61 streaming references produced the expected unsupported diagnostic. These models contain no service renames; targeted tests cover those. This validation is local, not a CI dependency.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.