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

[typespec-vscode] Make 'convert to object value' code fix recursive #5342

Merged

Conversation

mzhongl524
Copy link
Member

Fix : #4613

There will be two quick fixes for this issue, and only by clicking on the quick fix of the entire expression can you get the desired result; If you click on the quick fix for a partial expression, because there is no recursive part in the middle of the partial expression, you need to click twice to get the desired result

… the quick fix of the entire expression can you get the desired result;

If you click on the quick fix for a partial expression, because there is no recursive part in the middle of the partial expression, you need to click twice to get the desired result
@azure-sdk
Copy link
Collaborator

azure-sdk commented Dec 12, 2024

All changed packages have been documented.

  • @typespec/compiler
Show changes

@typespec/compiler - feature ✏️

Convert model/tuple expression to value code fix is applied to the entire value.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Dec 12, 2024

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs 🛝 VSCode Extension

@RodgeFu RodgeFu added the ide Issues for VS, VSCode, Monaco, etc. label Dec 18, 2024
@RodgeFu RodgeFu changed the title [Not Ready] [typespec-vscode] Make 'convert to object value' code fix recursive [typespec-vscode] Make 'convert to object value' code fix recursive Dec 18, 2024
@chrisradek
Copy link
Member

Can this also support converting tuples to value syntax?

@example({ Bar: [ {Baz: "Hello"}, [ "foo" ] ] })
// to
@example(#{ Bar: #[ #{Baz: "Hello"}, #[ "foo" ] ] })

@RodgeFu RodgeFu requested a review from chrisradek January 17, 2025 07:13
Copy link
Member

@timotheeguerin timotheeguerin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works great!

@RodgeFu RodgeFu added this pull request to the merge queue Jan 22, 2025
Merged via the queue into microsoft:main with commit a750945 Jan 22, 2025
24 checks passed
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 ide Issues for VS, VSCode, Monaco, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: "convert to an object value" code fix is not recursive
5 participants