Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 switch enum completion

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
znakeeye Posted - Sep 25 2009 : 05:09:45 AM
I want VAX to produce this (using a shortcut/command or whatever):

switch (myEnum)
{
case enumValue1:
    break;
case enumValue2:
    break;
...
case enumValueN:
    break;
}


Shouldn't be too hard?
7   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Aug 21 2015 : 12:26:57 AM
case=19137 is implemented in build 2073 as the command "Add Missing Case Statements"
feline Posted - Oct 01 2009 : 09:01:22 AM
This makes sense. I have added a note to case=19137 about this.
znakeeye Posted - Sep 29 2009 : 04:46:58 AM
I mean that the last menu item should fill the switch-statement with the remaining enum items!

switch (myEnu|
Menu is shown with all current alternatives + "Add all myEnum constants" to produce the complete switch-statement!

Or, if I later type "case":

switch (myEnum)
{
case myEnum1:
    break;
case my|
Menu is shown with all current alternatives + "Add all myEnum constants" to produce the complete switch-statement!

// Complete switch statement would look something like this:
switch (myEnum)
{
case myEnum1:
    break;
case myEnum2:
    break;
case myEnum3:
    break;
default:
    // ASSERT(FALSE);
    break;
}


For enums with no name (e.g. enum { a, b, c };) you obviously need to change the string "Add all myEnum constants" to "Add all related enum constants" or similar. You do the English! :P
feline Posted - Sep 28 2009 : 09:18:03 AM
I am not sure I understand. Do you mean the second item in the menu would trigger the refactoring command?
znakeeye Posted - Sep 28 2009 : 03:19:06 AM
A possibility is to show a "VAX paste menu" when you complete the first case-statement, similar to this:
enum MyEnum { myEnum1, myEnum2, myEnum3 };
switch (myEnum)
{
case my

shows:
[ myEnum1 ]
[ Complete all MyEnum constants ]
feline Posted - Sep 25 2009 : 11:20:02 AM
For now the new scoped suggestions will suggest the enum items after each "case" keyword, making it a lot easier to write these switch statements manually.
sean Posted - Sep 25 2009 : 11:02:57 AM
We're thinking about this, but aren't sure of the best way to trigger it. You type myEnum and exec a command to produce the whole switch statement? case=19137

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000