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

Automatically add missing using directives #45853

Closed
mikadumont opened this issue Jul 9, 2020 · 3 comments
Closed

Automatically add missing using directives #45853

mikadumont opened this issue Jul 9, 2020 · 3 comments
Assignees
Labels
Area-IDE Feature Request User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@mikadumont
Copy link
Contributor

mikadumont commented Jul 9, 2020

Direct customer ask copying here:

When copying and pasting types to a file the using directives should automatically get added rather than having to add them manually:
image

@vatsalyaagrawal vatsalyaagrawal added Area-IDE Feature Request Need Design Review The end user experience design needs to be reviewed and approved. labels Jul 10, 2020
@vatsalyaagrawal vatsalyaagrawal added this to the Backlog milestone Jul 10, 2020
@CyrusNajmabadi
Copy link
Member

I'm very hesitant about that. It may take a fast operation and make it extremely slow. Today we already have a feature that lsitens for paste and proffers Asynchronously the lightbulb that will adding usings if the user wants to do that. That model both serves this need, and doesn't cause undue delays for users trying to do normal activities.

Note: thsi perf concern is not a hypothetical. Pasting in VB is commonly extremely slow as we do code-cleanup autoamtically on that text. This may mean unbounded work as we construction compilations and the like.

@allisonchou
Copy link
Contributor

Conclusion from design meeting (7/13):
Our current idea is to timebox this feature (~0.5s). If allotted time is exceeded, we will still offer the feature as a lightbulb item with high priority, i.e. first or second item in list.

@allisonchou allisonchou removed the Need Design Review The end user experience design needs to be reviewed and approved. label Jul 13, 2020
@ryzngard ryzngard self-assigned this Sep 29, 2020
@ryzngard ryzngard modified the milestones: Backlog, 16.9 Sep 29, 2020
ryzngard added a commit that referenced this issue Nov 20, 2020
Addresses #45853

Hook up paste command to also automatically add usings. Operation uses thread await dialog to pop up to a user if it is taking a while with a "cancel" button. The dialog will not always show, but follows the IUIThreadOperationContext scope rules

Edit:

This is disabled by default. The following followup issues were filed
#49442
#49443
#49444
@jinujoseph jinujoseph modified the milestones: 16.9, 16.10 Mar 28, 2021
@jinujoseph jinujoseph modified the milestones: 16.10, Backlog Jul 16, 2021
@jmarolf jmarolf added the User Story A single user-facing feature. Can be grouped under an epic. label Dec 2, 2021
@ryzngard
Copy link
Contributor

ryzngard commented Dec 9, 2021

This feature is done at this point. #49442 tracks us adding an async version which we believe we could enable by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request User Story A single user-facing feature. Can be grouped under an epic.
Projects
Archived in project
Development

No branches or pull requests

7 participants