TypeSchema: Precompute base names for profile methods#132
Merged
Conversation
Move collision-free base name resolution from the TypeScript generator into the TypeSchema layer so all language generators can reuse it. - Add NameCandidates type (candidates[] + recommended) to types.ts - Add nameCandidates field to ProfileExtension and FieldSlice - New module: src/typeschema/core/name-candidates.ts - Language-neutral candidate generation for extensions and slices - Collision resolution via multi-level candidate priority - assignRecommendedBaseNames() sets recommended after profile is built - Remove resolveProfileMethodBaseNames and related helpers from profile.ts - Remove 6 dead name functions from typescript/name.ts - Update TS generators to consume nameCandidates.recommended directly
…lution Instead of skipping field accessors that collide with slice/extension names, treat field names as reserved during collision resolution so slices/extensions get bumped to qualified names. All field accessors are now always generated.
Field names like 'value IVL_TS' (CCDA) need camelCase normalization before uppercasing to produce valid method names.
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.
Summary
NameCandidatestype (candidates: string[]+recommended: string) toProfileExtensionandFieldSlicesrc/typeschema/core/name-candidates.ts:assignRecommendedBaseNames()setsrecommendedafter profile TypeSchema is builtresolveProfileMethodBaseNames,resolveNameCollisions, and 6 dead name helpers from the TS generatornameCandidates.recommendeddirectlyBefore (each language must re-implement collision detection):
After (collision-free names precomputed on TypeSchema):