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

Converting JSON to values in code fixes #4612

Open
3 tasks done
Arithmomaniac opened this issue Oct 6, 2024 · 0 comments
Open
3 tasks done

Converting JSON to values in code fixes #4612

Arithmomaniac opened this issue Oct 6, 2024 · 0 comments
Labels
design:needed A design request has been raised that needs a proposal feature New feature or request ide Issues for VS, VSCode, Monaco, etc. triaged:core
Milestone

Comments

@Arithmomaniac
Copy link

Clear and concise description of the problem

People may have JSON on hand when trying to create examples for their models, but examples are expected to be values.

It would be nice if the existing "convert to an object value" code fix that handles when you drop a model into a spot designated for a value [Playground]:

@example(#{"Baz": "Hello"})
model FooBar { Baz : string; }

would turn it into a value

@example(#{Baz: "Hello"})

instead of to an invalid value [Playground]:

@example(#{"Baz": "Hello"})

This would ease migrations to TypeSpec while removing a case where a codefix leaves invalid code after being applied.

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@markcowl markcowl added design:needed A design request has been raised that needs a proposal ide Issues for VS, VSCode, Monaco, etc. feature New feature or request labels Oct 14, 2024
@markcowl markcowl added this to the Backlog milestone Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design:needed A design request has been raised that needs a proposal feature New feature or request ide Issues for VS, VSCode, Monaco, etc. triaged:core
Projects
None yet
Development

No branches or pull requests

2 participants