Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Possible to make snippet that converts comments?

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
Zeblote Posted - Oct 05 2018 : 2:10:49 PM
Is it possible to make a VA snippet that turns

/** stuff */

into

/**
 * stuff
 */

?
6   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 08 2018 : 06:16:25 AM
Once I pinned down the required steps, this did just work for me. But finding those steps took a little bit of searching and sorting out.
Zeblote Posted - Oct 06 2018 : 10:13:02 AM
Hmmmmm now I'm wondering if there might have been a bug in VS 15.8.5, because I just tried to use your file on a new project and *it works*! :D
feline Posted - Oct 06 2018 : 09:28:23 AM
Not entirely off topic, since this is still about code formatting.

I have clang format doing things here, I am using VS2017, currently version 15.8.4 on this machine, but it's now due for an update. The clang file is called ".clang-format", have fun creating that file in Windows I ended up naming the file ".clang-format." in Windows Explorer, at which point Windows removed the trailing dot, leaving me with just the leading dot.

The file content is:

# child level Clang Format file
BasedOnStyle: LLVM
BreakBeforeBraces: Linux
AllowShortIfStatementsOnASingleLine: false
UseTab: Never


the file is NOT added to the solution, but it is in the same directory as code files I want formatted with these rules. It also works for sub-directories, but not parent directories. Also make sure Clang format is Enabled in the IDE C/C++ Formatting settings, and that you then trigger a reformat command in the code file once the clang format file is saved out.
Zeblote Posted - Oct 06 2018 : 09:20:55 AM
I've actually tried to use a clang format file with VS before, but did not manage to get it to do anything. It acts as if the file doesn't exist, even though it's in the project folder and added to the solution like the instructions say. VS support is not being helpful either, guess that's expected when using the community version.

...I'm going kinda off topic here..
feline Posted - Oct 06 2018 : 08:22:57 AM
Which IDE are you using? If you are using VS2017 you might want to look into the C++ formatting options the IDE offers. You can even use a clang format file, which will give you quite a lot of control on how code is formatted, once you get the rules set up as you want them.
Zeblote Posted - Oct 05 2018 : 2:26:20 PM
Nvm, turns out placing the cursor right before stuff and pressing return does this already.

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