-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 auto imports in opening JSX tag #44724
Conversation
tryGetGlobalSymbols(); | ||
symbols = tagSymbols.concat(symbols); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here’s where all the symbols already in symbols
got their indices shifted by tagSymbols.length
, messing up the coordination with the maps that referenced the indices of this array.
@typescript-bot cherry-pick this to release-4.3 |
Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into |
Hey @DanielRosenwasser, I've opened #44822 for you. |
Component commits: 5545946 Fix auto imports in opening JSX tag
Component commits: 5545946 Fix auto imports in opening JSX tag Co-authored-by: Andrew Branch <andrew@wheream.io>
This PR introduced a breaking change from the 4.4 branch in a 4.3.x patch release. Upgrading to version 4.3.5, I now see this breaking change: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#using-unknown-in-catch-variables @DanielRosenwasser Can this change please be reverted asap on the 4.3.x branch? |
This PR fixes auto imports in JSX tags and nothing else. Moreover, https://unpkg.com/typescript@4.3.5/lib/typescript.js has no reference to |
@andrewbranch I was able to consistently break/fix my TS by swapping between version 4.3.4 and 4.3.5. But I'll check again to reconfirm that I didn't do anything goofy. |
@andrewbranch I went back and carefully did a clean install of my modules, then tried bumping from version 4.3.4 to 4.3.5 and the problem I was seeing yesterday did not recur. My steps yesterday involved repeated upgrading and downgrading to different versions (e.g. 4.3.4->4.4.2->4.3.5->...) so something must have gotten messed up in that process. 🤷 Please disregard and sorry for the noise. |
No problem @Ghazgkull, thanks for confirming 😄 |
Fixes #44657
Sometime in 4.3 I changed the completion symbol sort text and origin maps to be keyed by the symbol index in the
symbols
array instead of by symbol id (since the same symbol can sometimes be imported in different ways, thus having more than one completion entry). Missed in that refactor was the fact that JSX opening tag completions shift all the intrinsic element symbols onto the beginning of the symbols array, offsetting the indices, such that no origins or sort text were found while creating the final completion entries. Pretty weird that there was no test coverage for that.