Skip to content

Does not add a duplicate completion when offering an export which was re-declared as a global #34524

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

Merged
merged 2 commits into from
Oct 17, 2019

Conversation

orta
Copy link
Contributor

@orta orta commented Oct 16, 2019

Fixes #32675

There are no duplication checks for exported completions, which is typically not a problem, but turns out to be an issue when you are taking a umd global and re-exporting it as a global internally.

Prior to my patch in completions.ts, this test would raise an error because of duplicate completions in the test. So the test verifies it doesn't crash and includes the assert.

@orta orta self-assigned this Oct 16, 2019
@orta orta merged commit 5d20c57 into microsoft:master Oct 17, 2019
Copy link
Member

@andrewbranch andrewbranch left a comment

Choose a reason for hiding this comment

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

Fantastic!

@@ -1464,7 +1465,7 @@ namespace ts.Completions {
}

/**
* Gathers symbols that can be imported from other files, deduplicating along the way. Symbols can be duplicates
* Gathers symbols that can be imported from other files, de-duplicating along the way. Symbols can be "duplicates"
Copy link
Member

Choose a reason for hiding this comment

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

🤷‍♂

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha, I guess code-spell check doesn't have it

Copy link
Member

Choose a reason for hiding this comment

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

I make up a lot of words but this wasn’t one of them! 😛

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.

Autocompletion doesn't suggest global variables exposed from dependent packages (regression)
3 participants