-
Notifications
You must be signed in to change notification settings - Fork 398
[WIP] Add support for deterministic naming in model suffix #11999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
69
commits into
main
Choose a base branch
from
copilot/support-deterministic-naming
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
62f2a61
Initial plan
Copilot d37edba
test(csharp): cover deterministic Response-to-Result model names
Copilot 4af1e99
feat(csharp): normalize Response model suffixes to Result
Copilot d9ed5f8
fix(csharp): account for Result-targeted customization aliases
Copilot 8c8f5d2
refactor(csharp): scope response name fallbacks to ModelProvider
Copilot dbba17b
refactor(csharp): keep response suffix normalization in ModelProvider
Copilot 2500c9a
refactor(csharp): reduce naming collision lookups and cover compatibi…
Copilot 9d543b6
refactor(csharp): consolidate response naming lookup helpers
Copilot 6584968
fix(csharp): honor customized result model names
Copilot 14a3556
perf(csharp): cache model naming lookups
Copilot 5cddfae
refactor(csharp): type model name cache entries
Copilot 6200dd5
refactor(csharp): make naming cache initialization lazy
Copilot b84a319
refactor(csharp): clarify naming cache invariants
Copilot 6287c0c
refactor(csharp): freeze naming cache entries
Copilot fd3e2b6
refactor(csharp): simplify cached alias state
Copilot c3558a0
refactor(csharp): bind name cache to generator
Copilot f7dc006
refactor(csharp): avoid copying name cache entries
Copilot 8df38f8
fix(csharp): simplify deterministic result collisions
Copilot 0c7dd43
fix(csharp): preserve shipped result name ownership
Copilot 052c3f7
refactor(csharp): clarify result ownership rules
Copilot 75d51a0
refactor(csharp): centralize customization lookup guard
Copilot 72192c8
refactor(csharp): unify model naming helpers
Copilot c109740
refactor(csharp): clarify model name conflicts
Copilot 7a1ef84
fix(csharp): reserve standalone result customizations
Copilot adaf048
refactor(csharp): inline customization reservation
Copilot 152c949
fix(csharp): isolate customized client model names
Copilot 9cd342a
refactor(csharp): unify customization collision checks
Copilot da5c60c
refactor(csharp): simplify model collision checks
Copilot f4511d0
fix(csharp): cover hidden model name collisions
Copilot 30f7b3f
fix(csharp): prevent physical model name collisions
Copilot 4eafe26
fix(csharp): match emitted model/enum criteria in Result collision scan
Copilot d4cd999
refactor(csharp): cache emitted naming inventory
Copilot 1402733
refactor(csharp): share emitted type collision cache
Copilot 05c7fd4
docs(csharp): clarify emitted collision cache rules
Copilot 11ec3fb
refactor(csharp): preserve customization enum scan
Copilot 30761ce
refactor(csharp): clarify emitted model predicate
Copilot 7bb4ae4
refactor(csharp): guard emitted type cache
Copilot b68d020
test(csharp): cover repeated emitted enum checks
Copilot d296398
refactor(csharp): simplify unknown variant cache scan
Copilot 1d1fb59
refactor(csharp): key emitted cache by generator
Copilot 3b8a98e
refactor(csharp): avoid retaining generator cache keys
Copilot a04613e
fix(csharp): reserve resolved external result names
Copilot 7188912
fix(csharp): ignore non-emitted enum customizations
Copilot 5b677bf
refactor(csharp): simplify model name collision checks
Copilot 3785df9
refactor(csharp): avoid unnecessary name normalization
Copilot 97911d4
test(csharp): clarify external collision coverage
Copilot ea76334
test(csharp): name external collision scenario
Copilot eaa3cd0
test(csharp): clarify external model collision cases
Copilot e1f18d3
test(csharp): distinguish external model collision cases
Copilot e9fa9f7
test(csharp): clarify external metadata behavior
Copilot 798cdee
test(csharp): name unresolvable external coverage
Copilot df7b9f3
test(csharp): clarify unresolvable CLR scenario
Copilot 78ff950
refactor(csharp): simplify emitted type caches
Copilot 6b997fd
refactor(csharp): restore external type encapsulation
Copilot 7fc54e2
refactor(csharp): inline emitted type caches
Copilot 261fd77
refactor(csharp): consolidate emitted type inventory
Copilot 3ff3b37
fix(csharp): break Result ownership ties deterministically
Copilot fa1f044
refactor(csharp): move emitted type filtering to InputLibrary
Copilot baed7a8
refactor(csharp): internalize non-external type inventories
Copilot 24c8f9d
refactor(csharp): remove duplicate response ownership
Copilot f9eb719
refactor(csharp): remove response collision detection
Copilot ebd8622
refactor(csharp): thread namespace through name normalization
Copilot 3aa8521
fix(csharp): scope CodeGenType aliases to their owning input type
Copilot 7623f29
docs(csharp): explain client-only customization ownership scope
Copilot 2b77efb
revert(csharp): restore BuildNamespace use in NormalizeTypeName
Copilot 72e21bb
refactor(csharp): simplify client customization lookup
Copilot 6fdba6f
refactor(csharp): remove client customization guard
Copilot 257f96d
revert(csharp): restore SourceInputModel lookup
Copilot d3e6088
Merge branch 'main' into copilot/support-deterministic-naming
jorgerangel-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
19 changes: 19 additions & 0 deletions
19
...ta/ModelProviderTests/TestBuildName_ResponseSuffixPreservesCustomName/CustomizedModels.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using Microsoft.TypeSpec.Generator.Customizations; | ||
|
|
||
| namespace Sample.Models | ||
| { | ||
| [CodeGenType("WidgetResponse")] | ||
| public partial class CustomizedWidget | ||
| { | ||
| } | ||
|
|
||
| [CodeGenType("IPResponse")] | ||
| public partial class CustomizedIP | ||
| { | ||
| } | ||
|
|
||
| [CodeGenType("GadgetResult")] | ||
| public partial class CustomizedGadget | ||
| { | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
...ta/ModelProviderTests/TestBuildName_ResponseSuffixPreservesExistingName/ExistingModels.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| namespace Sample.Models | ||
| { | ||
| public partial class WidgetResponse | ||
| { | ||
| } | ||
|
|
||
| public partial class IPResponse | ||
| { | ||
| } | ||
|
|
||
| public partial class DbResponse | ||
| { | ||
| } | ||
| } |
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.