Navigation Menu

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 misplaced comma in auto imported specifier #40273

Merged
merged 1 commit into from Aug 31, 2020

Conversation

andrewbranch
Copy link
Member

Fixes #40219

Note: insertNodeAfter and insertNodeAtEndOfList are pretty dumb, and should probably be deleted, because insertNodeInLastAfter is very smart.

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Aug 26, 2020
@andrewbranch
Copy link
Member Author

I think this would be a good candidate for VS Code's next servicing release.

@DanielRosenwasser
Copy link
Member

@typescript-bot cherry-pick this to release-4.0

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 28, 2020

Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into release-4.0 on this PR at 2c0e01a. You can monitor the build here.

@DanielRosenwasser
Copy link
Member

Note: insertNodeAfter and insertNodeAtEndOfList are pretty dumb, and should probably be deleted, because insertNodeInLastAfter is very smart.

Can you explain a bit more here?

@typescript-bot
Copy link
Collaborator

Hey @DanielRosenwasser, I've opened #40303 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Aug 28, 2020
Component commits:
2c0e01a Fix misplaced comma in auto imported specifier
@andrewbranch
Copy link
Member Author

@DanielRosenwasser insertNodeInListAfter has a bunch of quite complex logic where it examines the previous list item to deduce how the list is formatted (i.e., what the separator is, and where line breaks and spaces should go), whereas insertNodeAtEndOfList just blindly inserts ", " + yourListItemText. But their names don’t suggest this discrepancy—insertNodeAtEndOfList just sounds like a special case of insertNodeInListAfter—which is how I made the mistake of using the dumb one in the first place.

@andrewbranch andrewbranch merged commit bfb00eb into microsoft:master Aug 31, 2020
@andrewbranch andrewbranch deleted the bug/40219 branch August 31, 2020 17:55
DanielRosenwasser pushed a commit that referenced this pull request Sep 15, 2020
Component commits:
2c0e01a Fix misplaced comma in auto imported specifier

Co-authored-by: Andrew Branch <andrew@wheream.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript auto-import put comma in wrong position
4 participants