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

Auto-generation of control events is not placing code correctly.... #37339

Closed
vsfeedback opened this issue Jul 18, 2019 · 2 comments
Closed

Auto-generation of control events is not placing code correctly.... #37339

vsfeedback opened this issue Jul 18, 2019 · 2 comments
Labels
Area-IDE Concept-Continuous Improvement Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Need Design Review The end user experience design needs to be reviewed and approved.
Milestone

Comments

@vsfeedback
Copy link

Visual Studio 2019, editing Visual Basic.Net code.
While working on a windows form with a single button control on the form. double-Clicking the button in design mode causes the "Click" event code to be autogenerated, presumably placed at the end of the form's Class (just before the "End Class" statement.

This usually works. However, if your class contains a #Region/#EndRegion at the end of the Class, AND that #Region contains a sub method, the auto-generated event code Opens the last region and inserts the event code between the EndSub and #End Regiion statements. The auto-generated code SHOULD be inserted just before the End Class statement by default, and not open any existing #Regions.

Please see my attachments for example code.

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/589218/auto-generation-of-control-events-is-not-placing-c.html
VSTS ticketId: 902148

These are the original issue comments:

Visual Studio Feedback System on 5/30/2019, 07:27 PM (48 days ago):

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

These are the original issue solutions:
(no solutions)

@vatsalyaagrawal vatsalyaagrawal added the Developer Community The issue was originally reported on https://developercommunity.visualstudio.com label Jul 18, 2019
@jinujoseph jinujoseph added Area-IDE Concept-Continuous Improvement Need Design Review The end user experience design needs to be reviewed and approved. labels Jul 23, 2019
@jinujoseph jinujoseph added this to In Queue in IDE: Design review via automation Jul 23, 2019
@jinujoseph jinujoseph added this to the Backlog milestone Jul 23, 2019
@jasonmalinowski jasonmalinowski moved this from In Queue to On deck in IDE: Design review Jul 25, 2022
@jasonmalinowski jasonmalinowski moved this from On deck to Next meeting in IDE: Design review Jul 25, 2022
@jasonmalinowski jasonmalinowski moved this from Next meeting to In Queue in IDE: Design review Aug 19, 2022
@CyrusNajmabadi
Copy link
Member

This doesn't repro for me.

@CyrusNajmabadi CyrusNajmabadi closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2022
@ScottyBlazor
Copy link

This happens for me all the time, now on VS 2022 17.5.1 but has always been an issue.
it should be as easy to reproduce as adding a region with some code in it just before the end class, collapsed the region.
then use the code window drop down boxes at the top of the screen to add an events code for a control or class,
it always goes in to the collapsed region (which does expand at that point). so you have to copy the new code and move it out.
I often use a hacky workaround when starting a new code file that will have a lot of events, where I add a new method down the bottom and call it NewMethodsBelowHere() just to stop it constantly expanding my last region and adding the code there.

I think kendrahavens post need consideration still, I posted the same request that was closed, here https://developercommunity.visualstudio.com/t/option-to-add-new-code-methods-at-cursor/553179

I have nicely structured code using regions for functionality, every time I add some new events to the code they go to the bottom and I'm constantly coping them and putting them back up to the location I was already at to keep the functionality nicely grouped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Concept-Continuous Improvement Developer Community The issue was originally reported on https://developercommunity.visualstudio.com Need Design Review The end user experience design needs to be reviewed and approved.
Projects
Status: In Queue
IDE: Design review
  
In Queue
Development

No branches or pull requests

5 participants