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

(fix) fix event completion with createEventDispatcher or with multiple declarations of the same event #1083

Merged
merged 2 commits into from
Jul 6, 2021

Conversation

jasonlyu123
Copy link
Member

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

@@ -57,14 +57,17 @@ export class JsOrTsComponentInfoProvider implements ComponentInfoProvider {
return type
.getProperties()
.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