Skip to content
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

Symbol refactor #4849

Merged
merged 93 commits into from
Nov 5, 2024
Merged

Conversation

timotheeguerin
Copy link
Member

@timotheeguerin timotheeguerin commented Oct 23, 2024

Augment decorator issues

Fix #4749 Augment/ref alias properties
Fix #2867 Augment/ref model is properties
Fix #4818 Augment/ref nested model properties

Circular reference issues

Fix #4908 freeze when using circular model extends with aliases

Others

FIx #4915 (Duplicate usings not scoped per namespace)

Doesn't resolve the alias circular issue #2824 but I think setup the solution for fixing it later in the name resolver where we could detect that cycle instead of the checker

@timotheeguerin timotheeguerin changed the title [WIP] Symbol refactor [WIP] Symbol refactor - DO NOT REVIEW Oct 23, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the compiler:core Issues for @typespec/compiler label Oct 23, 2024
@azure-sdk
Copy link
Collaborator

azure-sdk commented Oct 23, 2024

All changed packages have been documented.

  • @typespec/compiler
Show changes

@typespec/compiler - feature ✏️

Overall of the symbol resolution. TypeSpec is able to resolve anything that can be statically linked. Augment decorators in turn are able to target any statically linkable types.

@typespec/openapi3 - internal ✏️

Fix test host

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@tadelesh
Copy link
Member

another thing is could this refactor resolve the spread issue? playground

@MaryGao
Copy link
Member

MaryGao commented Oct 30, 2024

Could you help guide on cases here? It seems not working. another question is any document on how to refer typemetada in typespec?

@timotheeguerin
Copy link
Member Author

another thing is could this refactor resolve the spread issue? playground

Spread of template parameter we cannot as it's something done dynamically, only works if we know the template param constraint
But now you can use an Alias to define the params

@timotheeguerin
Copy link
Member Author

Could you help guide on cases here? It seems not working. another question is any document on how to refer typemetada in typespec?

Did you meant to share more in your playground @MaryGao? Not sure what you meant?

packages/compiler/src/core/binder.ts Outdated Show resolved Hide resolved
packages/compiler/lib/intrinsics.tsp Outdated Show resolved Hide resolved
packages/compiler/src/core/name-resolver.ts Show resolved Hide resolved
packages/compiler/src/core/name-resolver.ts Show resolved Hide resolved
packages/compiler/src/core/name-resolver.ts Show resolved Hide resolved
packages/compiler/src/core/name-resolver.ts Outdated Show resolved Hide resolved
packages/compiler/src/core/name-resolver.ts Outdated Show resolved Hide resolved
packages/compiler/src/core/name-resolver.ts Outdated Show resolved Hide resolved
@timotheeguerin timotheeguerin added this pull request to the merge queue Nov 4, 2024
Merged via the queue into microsoft:main with commit b39abe5 Nov 5, 2024
22 checks passed
@timotheeguerin timotheeguerin deleted the symbol-refactor-2 branch November 5, 2024 00:15
swatkatz pushed a commit to swatkatz/typespec that referenced this pull request Nov 5, 2024
### Augment decorator issues
Fix microsoft#4749 Augment/ref alias
properties
Fix microsoft#2867 Augment/ref `model
is` properties
Fix microsoft#4818 Augment/ref nested
model properties

### Circular reference issues
Fix microsoft#4908 freeze when using
circular model extends with aliases

### Others
FIx microsoft#4915 (Duplicate usings
not scoped per namespace)

Doesn't resolve the alias circular issue
microsoft#2824 but I think setup the
solution for fixing it later in the name resolver where we could detect
that cycle instead of the checker

---------

Co-authored-by: Brian Terlson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:core Issues for @typespec/compiler
Projects
None yet
6 participants