The name snippet implies adding code. I think you are trying to change existing code and that is not what snippets are designed for. I think that is what the other answer is saying. If I misunderstand what you are saying then please explain what you need without the animation.
Visual Studio IDE Code snippet to convert field from upper case to lower case
I would like to accomplish the following in a C++ class via a Visual Studio 2019 IDE code snippet:
Link here, reproduced below:
which creates a variable name (to hold a constant) in UPPERCASE letters and creates related function names in lowercase of the same name.
The above is accomplished in VSCode via the following code snippet:
"var set getx":{
"prefix": "varsetgetx",
"body":[
"${1:int} ${2:VARNM};",
"$1 ${2/(.*)/${1:/downcase}/}(){return $2;}",
"void ${2/(.*)/${1:/downcase}/}($1 val){$2 = val;}"
]
}
Is there a way to accomplish this in Visual Studio IDE 2019? There seems to be only one other question I could find, but that is from back in 2006, more than 15 years ago. That thread is here.
The answer on that thread unfortunately was that it would not be possible to accomplish something like this. Is it still the case that this is not possible now using the latest VS 2019 IDE?
Thank you.
3 answers
Sort by: Most helpful
-
-
Minxin Yu 10,121 Reputation points Microsoft Vendor
2021-09-27T09:43:39.463+00:00 Hi,
I suggest you directly suggest this feature to Visual Studio Product Team in our Developer Community, and if you do suggest this feature, please share the link here, other forum members who are interested or needed this feature will go to vote for this thread.
Best regards,
Minxin Yu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
-
Tryer_Git 1 Reputation point
2021-09-27T15:22:48.223+00:00 As suggested, I have opened a feature request here:
https://developercommunity.visualstudio.com/t/Visual-Studio-IDE-Code-snippet-to-conver/1540445