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

Request: Intellisense should still work when union() is in use #3605

Open
JustinGrote opened this issue Jul 14, 2021 · 3 comments
Open

Request: Intellisense should still work when union() is in use #3605

JustinGrote opened this issue Jul 14, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request type system

Comments

@JustinGrote
Copy link

Is your feature request related to a problem? Please describe.
When using union() to specify property defaults for a resource, but then selectively overriding/adding additional, intellisense should still be able to infer the property types and offer completions within this context.
image

@JustinGrote JustinGrote added the enhancement New feature or request label Jul 14, 2021
@ghost ghost added the Needs: Triage 🔍 label Jul 14, 2021
@anthony-c-martin
Copy link
Member

anthony-c-martin commented Jul 14, 2021

This should be relatively simple to implement by adding a .WithDynamicReturnType() definition here. Just need to be careful to match ARM's behavior (e.g. in cases where both objects contain the same key), and to handle merging complex types such as any, objects containing additionalProperties, and discriminated objects in a sane way (or just fall back to returning object).

@majastrz
Copy link
Member

The logic for merging the two objects will also be similar to what we need to do to offer property name completions on array literals. I'd like to tackle it then.

@majastrz majastrz self-assigned this Jul 14, 2021
@alex-frankel alex-frankel added this to the Committed Backlog milestone Jul 21, 2021
@asdkant-bf
Copy link

Are there any updates on this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request type system
Projects
None yet
Development

No branches or pull requests

5 participants