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

[Bug]: The code snippet for union is ambiguous in TypeSpec extension. #5760

Closed
4 tasks done
lirenhe opened this issue Jan 27, 2025 · 0 comments · Fixed by #6137
Closed
4 tasks done

[Bug]: The code snippet for union is ambiguous in TypeSpec extension. #5760

lirenhe opened this issue Jan 27, 2025 · 0 comments · Fixed by #6137
Assignees
Labels
bug Something isn't working ide Issues for VS, VSCode, Monaco, etc.

Comments

@lirenhe
Copy link
Member

lirenhe commented Jan 27, 2025

Describe the bug

I got the following when I tried the code snippet for union

union Name = variant1 | variant2;

It is ambiguous as in https://typespec.io/docs/language-basics/unions/.

we could either define it as expression

alias Breed = Beagle | GermanShepherd | GoldenRetriever;

or as named union

union Breed {
  beagle: Beagle,
  shepherd: GermanShepherd,
  retriever: GoldenRetriever,
}

The code snippet seems to be a mix of the above.

Reproduction

As described above

Checklist

@lirenhe lirenhe added bug Something isn't working ide Issues for VS, VSCode, Monaco, etc. labels Jan 27, 2025
github-merge-queue bot pushed a commit that referenced this issue Mar 1, 2025
Fix: #5760

Fix code snippet for union in typespec-vscode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ide Issues for VS, VSCode, Monaco, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants