Skip to content

Conversation

@jasonlyu123
Copy link
Member

The generic type parameter is not in the valueDeclaration property of the typescript symbol.

.map((prop) => {
if (!prop.valueDeclaration) {
// currently there should only be one because svelte2tsx doesn't merge event dispatcher types
// And interface ($$Events) can't merge property type
Copy link
Member

Choose a reason for hiding this comment

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

Not sure how to interpret this sentence. In #938 merging multiple decent dispatcher definitions was done. Are completions working for these, too?
Not saying we need to fix that right away if not, since this is arguably an edge case

Copy link
Member Author

Choose a reason for hiding this comment

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

I tested it. Even if there're multiple declarations the type would still be correct. I think I'll remove the comment and add another test for union type.

@jasonlyu123 jasonlyu123 changed the title (fix) fix createEventDispatcher event completion (fix) fix event completion with createEventDispatcher or with multiple declarations of the same event Jul 6, 2021
@dummdidumm dummdidumm merged commit 9949a3a into sveltejs:master Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants