Author |
Topic |
|
kennyl
Ketchup Master
50 Posts |
Posted - Dec 11 2009 : 02:23:18 AM
|
Suppose I already have written a dozen of declarations of member functions in .h and now I want to do the implementation part, I have to create implementations from the context menu one function by one function, can this be done in more simpler way like "Create from selection stuff"?
"Create Declaration" can be done in a similar way?
Thanks. |
Edited by - kennyl on Dec 11 2009 02:28:54 AM |
|
feline
Whole Tomato Software
United Kingdom
19019 Posts |
Posted - Dec 11 2009 : 11:10:38 AM
|
We are considering letting you select several items at once in VA Outline and then triggering a single refactoring command on all of them at once:
case=7787
Selecting several items at once in the editor is more tricky, since there are quite a few edge cases to consider :) |
zen is the art of being at one with the two'ness |
|
|
CamyDee
New Member
USA
2 Posts |
Posted - Dec 16 2009 : 1:23:41 PM
|
If the functions are part of an interface, Visual Studio will create empty implementations for you, right-click the interface name and select > Implement or > Implement Explicit depending on which way you want to go. It will also look for existing members which already implement one or more of the functions, and leave yours. |
|
|
Arnt
Junior Member
20 Posts |
Posted - Mar 22 2010 : 05:35:34 AM
|
I had the same idea today while right clicking 10 functions to do 'create implementation'. Would be nice with selection in the text editor! |
|
|
feline
Whole Tomato Software
United Kingdom
19019 Posts |
Posted - Mar 23 2010 : 3:25:49 PM
|
For selecting in the text editor, consider a function declaration that is split across 3 lines. If one of these three lines is selected, is the function selected or not?
What if the function declarations are not next to each other in the editor? Then you cannot select all of them in one go in the editor.
VA Outline bypasses both of these edge cases, allowing you to clearly and easily indicate the declarations you want to operate on. |
zen is the art of being at one with the two'ness |
|
|
Arnt
Junior Member
20 Posts |
Posted - Mar 24 2010 : 04:45:35 AM
|
I don't see these as edge cases.
The selection certainly isn't an issue, that goes for everything that works on selection (what if I want to copy 2 parts of text...) or cursor position (e.g. refactorings, what if I want to move multiple implementations to the .cpp file).
The selection also seems simple: if any part is selected, it's selected. Especially for create implementation, this isn't a big problem: at worst, two empty functions to much are created. If you happen to select an existing function, it already has an implementation, so that isn't a problem either.
By all means, implement it on the outline, but I don't see any big issues with implementing it on the context menu as well. If you are really afraid of doing things people don't expect, change the context menu text to 'Create implementations for 6 functions' if you have 6 functions selected. |
|
|
feline
Whole Tomato Software
United Kingdom
19019 Posts |
Posted - Mar 29 2010 : 4:59:08 PM
|
The selection, it is down to what people expect. If you select a #define or key word that goes before the return type is the function selected? Part of a line selection? Since this is debatable some people will be surprised at what counts as selecting the function.
Currently VA does not know if a function has an implementation or not. Matching declarations to implementations is difficult when you consider overloaded functions.
VA Outline is an easy way of selecting the functions you want to act on, without any ambiguity. |
zen is the art of being at one with the two'ness |
|
|
Arnt
Junior Member
20 Posts |
Posted - Mar 30 2010 : 03:13:23 AM
|
I see your point about function selection, however, I still think a simple rule like 'if part of the function name is selected, it's selected' would be adequate. I'd think people could easily understand that.
Currently VA does not know if a function has an implementation or not.
True, but that doesn't stop 'create implementation' from saving me a lot of time, so I don't see a problem for creating multiple implementations?
VA Outline is an easy way of selecting the functions you want to act on, without any ambiguity.
Also true, BUT it means you have to go look in another window, which I find myself not doing so easily. |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Oct 24 2012 : 4:00:10 PM
|
Build 1912 supports mass Create Implementation when invoked on the class. |
|
|
|
Topic |
|