Unused procedures vanish automatically on compile.
When I compile or debug the program I want all unused procedures to vanish automatically. (example: Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged End Sub should vanish when debug/compile if no code is inside it.)
This worked in VB6.
7 comments
-
Torbjörn Görtz
commented
To Draco - Wy on earth do you want to keep empty procedures - which was created automatically by the IDE? If you dont use them by putting code inte them - why keep them?
-
Draco Paladine
commented
Absolutely NO, this would break a number of interface requirements.
-
Torbjörn Görtz
commented
Only empty sub procedures which are automatically created by the IDE should vanish (just like in VB6). If you doubleclick on control but don't put any code into the new procedure it should vanish automatically on compile.
-
Marc Johnston
commented
no vote ... you got to be kidding
-
Nick Roberts
commented
Maybe it should be a specific refactoring option, which can be applied to a whole project as well as to a specific class (or file)?
It could be counteracted in a specific procedure by putting a comment in it? (E.g. a TODO.)
-
Torbjörn Görtz
commented
My intention is thas only empty sub procedures which are automatically created by the IDE, when you double click on a control, are going to be removed. On VB6 this type of sub procedures vanish when you run a full debug - and manually created sub procedures are left unchanged. This is exactly the way I want it.
-
Paul
commented
As long as it's optional! Are we talking about deleting such out of source, or simply not including it in compile/debug? I can't be the only one who often has empty procedure stubs here and there, waiting to get either fleshed out or [manually] deleted.