Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Flexible upper and lower case in snippet

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
jayden_shui Posted - Jan 29 2013 : 8:55:56 PM
For example

$Type$ m_$name$;
const $Type$& $name$() const {return m_$name$;}
void set$Name$(const $Type$& $name$) {m_$name$ = $name$;}

In the dialog, only need the user to input $name$. $Name$ can be derived from $name$ with a upper case letter leading. Thanks.
9   L A T E S T    R E P L I E S    (Newest First)
chrisaverage Posted - Feb 27 2014 : 04:34:05 AM
Oh, thanks sean! I didn't know about that.
sean Posted - Feb 26 2014 : 7:50:33 PM
Use $generatedPropertyName$

It generates the same property name as $GeneratedPropertyName$ except that first letter is lower-case.
feline Posted - Feb 26 2014 : 7:19:41 PM
This makes sense, we are considering adding this ability:

case=66480

Unfortunately I don't currently have an estimate for when this will be done.
chrisaverage Posted - Feb 20 2014 : 08:31:21 AM
Hi,
I have a sorta related question. I use this convention:

int someSymbol_;
inline int someSymbol() const { return someSymbol_; }
void setSomeSymbol(int symbol) { someSymbol_ = symbol; }

I can *almost* do this with the snippet except it generates SomeSymbol() instead of someSymbol(). Not a big problem but there's this single letter that I need to fix every time :)
Would it be possible to add the _Camel and _Pascal modifiers to the built-in variables like $GeneratedPropertyName$?
I tried to use $GeneratedPropertyName_Camel$ but it prompts for an input for GeneratedPropertyName which is of course not what I want.
jayden_shui Posted - Feb 02 2013 : 12:48:23 AM
Cool! Very convenient feature.
sean Posted - Feb 01 2013 : 10:47:42 PM
Slight correction: Pascal makes first character Upper and camel makes first character lower.
feline Posted - Feb 01 2013 : 9:18:01 PM
Given my snippet, when prompted, type "Feline" into the dialog, this will then insert the code:

// lower name = m_feline
// upper name = m_FELINE
// entered name = m_Feline


It turns out two further modifiers have also been added, "_Camel" and "_Pascal", which are designed to help with camel case. "_Camel" upper cases the FIRST letter ONLY, and "_Pascal" lower cases the FIRST letter ONLY. Neither tries to identify word boundaries.

So you could have the snippet:

// lower name = m_$name_Lower$
// upper name = m_$name_Upper$
// camel name = m_$name_Camel$
// pascal name = m_$name_Pascal$
// entered name = m_$name$


which should give you a good range of options.
jayden_shui Posted - Feb 01 2013 : 08:20:55 AM
Thank you. I tried but cannot make it no matter whether I input "name" or "Name". The "_Lower" is entirely lower case, while the "_Upper" is entirely the upper case. How to get camel case?

The feature may be extended by introducing
"_Upper_All"
"_Upper_First"
"_Lower_All"
"_Lower_First"

Thanks.
feline Posted - Jan 30 2013 : 8:53:50 PM
So long as you are using a recent build of VA you can already do this. The sample VA Snippet code:

// lower name = m_$name_Lower$
// upper name = m_$name_Upper$
// entered name = m_$name$


shows how to do this. To produce the camel case effect enter "Name" when prompted, since the _Upper and _Lower modifiers make the string entirely upper or lower case.

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