How to import Visual Assist snippets to Visual Studio 2017? - c++

I have downloaded the latest Visual Studio Community and InteliSense seems to work well even without the Visual Assist plugin, save a few bugs. I'd therefore like to continue working without the plugin.
I had plenty of code snippets in Visual Assist. How can I migrate them to visual studio 2017 without Visual Assist?

I can get you started:
Visual Studio expects XML:
https://learn.microsoft.com/en-us/visualstudio/ide/walkthrough-creating-a-code-snippet
Visual Assist stores its snippets in a legacy, non-XML format. Fortunately, you can "export" XML using the VA Snippet Editor. Open the editor; multi-select in the list; copy; paste into an external editor.
If the snippets you want to export share words in their descriptions or follow a pattern, you can simplify the multi-select by limiting what appears in the list. Change the Type dropdown to "Search", then search a field by string or regex.
I don't have a convenient way to convert from one XML format to the other.

Related

How to set a custom extension in Visual Studio Code

I enjoy writing code in Visual Studio Code. But the .tpl extension in Opencart is actually a file with PHP and HTML, but Visual Studio Code does not recognize this extension. Is it possible to teach Visual Studio Code to open .tpl as html? I mostly do the code in PS pad. Thank you, Ondra
I tried searching on google and didn't find much. Maybe I can't ask the question.

How do i change the colours of visual studio? [New user]

Im currently a C++ student in uni. I started using visual studio code configurated by a friend and then i changed to visual studio 2022 (the community version).
In visual studio code the code looks prrety much like this:
Then in visual studio it looks like this:
Does anyone know how to change the highlighted or at least can give me a hint? thanks!
I tried looking in the settings on visual studio but i got confused since there are many options and i dont know exactly what to change
You are probably looking for the Visual Studio Theme Pack extension, which brings the default VS code themes to VS. Also see this blog post for other converted popular VS code themes, and this blog post which describes a tool to convert any VS code theme.
Regarding the colored (rainbow) braces, there is the "Rainbow Braces" extension (corresponding blog post).
For further configuration, you might also want to have a look at the Visfora extension, which also includes rainbow braces.
Extensions aside, many of the colors can also be manually and individually configured in the Visual Studio's options → Environment → Fonts and Colors.

How to apply format when saving in Visual Studio 2022?

I have placed a .clang-format file in my project and can apply the formatting with Ctrl+K, Ctrl+D. I have also configured and enabled "Run Code Cleanup profile on Save" under Options -> Text Editor -> Code Cleanup. But when I save a file, the formatting is not applied.
Is there something I'm missing?
Thank you in advance!
Edit: Since it does not seem to be possible for C++ (as of June 2022), I will be using the extension Format on Save for VS2022 for now, which has a bit more functionality compared to Sedenion's suggestion.
You can use the free "Format document on Save" extension (github) to format C++ code via clang-format in Visual Studio 2022 on saving.
Side note, in case anyone else is reading this: In Visual Studio 2017 and 2019 you can also use the Microsoft extension "Power Commands for Visual Studio" for this purpose.
Unfortunately, Code Cleanup only applies to C# and VB.Net, and not to C++ code.
From MS documentation
For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup

Creating markdown files with Visual Studio 2019

So I have been making presentations and projects using Rmarkdown and Jupyter Notebooks. This is great because I can breakdown parts as needed and run code a section at a time. Now my projets require cpp, and I have been using Visual Studio 2019, in the new project folder I have been unable to find a way markdown option.
I did find this link: https://stackoverflow.com/questions/889434/markdown-implementations-for-c-c?r=SearchResults&s=1|64.2071
However most of these are quite old answers, and those that are still being updated seem to be for Visual Studio CODE not VS2019.
Mads Kristensen released a new, "complete rewrite of the original Markdown Editor with tons of fixes, tweeks, and performance improvements" (as stated in his Github Repo).
It is the best solution if you work with .MD files within your Visual Studio projects and solutions.
Also, it works with Visual Studio 2022 too.
Here is the simplest way to find and install it:
Inside your Visual Studio IDE, just go to Extensions -> Manage Extensions -> Online and then type "markdown editor v2" at the search box.

C++ copy formatted code to word (like Visual assist's)

I've browsed but could not find an answer..
I'm trying to copy code from my editor to look like the VA coloring, but it only copies like the VS coloring..
(Another great option would be to somehow do it like StackOverflow formats, but I could not find how to do that as well)
I've found:
http://www.wholetomato.com/products/features/rtf.asp
But it does not show where it is, nor can I find it (VS 2010)..
Does anyone know how to do it?
Or does anyone has an idea on how to copy formatted code to word?
Thanks!
A quote from the page you linked to:
Microsoft Visual Studio
Copying HTML to the clipboard is a built-in feature of Microsoft Visual
Studio and Visual Assist X does not enhance the feature. The
clipboard contains only the default colors of the IDE. Enhanced syntax
colors are not placed in the clipboard.
So it seems like what you want cannot be done.
If your ultimate goal is to make a final pdf, you can convert text file to pdf and combine your code pdf to your word pdf. You can try notepad++ for your default coloring your code.
Sorry but,
Microsoft Visual Studio
Copying HTML to the clipboard is a built-in feature of Microsoft Visual Studio and Visual
Assist X does not enhance the feature. The clipboard contains only the default colors of
the IDE. Enhanced syntax colors are not placed in the clipboard.
The feature you've meant was available only at Visual C++ 6.0.
VC++ 6.0 has no embedded ability to copy formatted code so they made their own realization of this feature in their plugin.
If you want just have VAssistX colored pdf you can try to print document in Visual Studio using any pdf printer such as PDFCreator then you can import it in Word (at least in LibreOffice Writer).