Print Resharper Live Templates - visual-studio

In there any way to print a list of all my templates in Resharper.
Recently, I installed the mnemonics plugin which have added a lot of templates and I'm lost in all these shortcuts.
It would be nice to have a pretty print list with every template shortcut, the description and a sample of the code. This will surely help me using more template then now.
Thanks.

Not exactly something you can print out, but I have a little project that can round trip Live Templates between .dotSettings and .md files. It can also generate a nice README.md that lists all of the templates, gives the description, and provides a link to the .md version of the template file.
You can see the mnemonics templates here: README.md

My answer concerns Mnemonics extention. There is no official print-friendly keymap yet. Fortunately, large set of mnemonics is based on few common principles (so I just printed main page to remember it). Of course, you can investigate each mnemonic in ReSharper Templates Explorer.

Related

VS F# canopy test adding folder

I want to ask you, if it´s somehow possible, to add folder, to sort out Test´s a little bit.. When i am doing in C# parts, there is normally option
right click-> add ->new folder
In F# case, it looks like it´s missing.
I tried to add it even out of VS, via the Win. explorer, but its not working.
Edit: I have found quite poor solution and that´s actually, that you create new folder in C# part and then cut it out and paste to F# section but it´s a bit weird, so any ideas are welcome.
It is not implemented in VS2013 but you can use F# Power Tools extension (http://fsprojects.github.io/VisualFSharpPowerTools/) or create it manually (http://marcinjuraszek.com/2014/03/folders-in-f-projects-how-to-do-it-what-to-avoid.html)
You can either use F# Project Extender or edit the project file manually. Details are here.
Edit: This article explains how to keep your project organized without folders.

Manage often used code in Visual Studio

When programming a big project, you often need the same pieces of code in different pages. calling methods, returning references, ...
Now, I always need to open a page, and copy paste parts from that. but I'm getting tired of that. There should be a better way to list very often used code. I've read about snippets but they seem a lot of work. How do you manage that?
Snippets are not a lot of work if you use one of the handy snippet-easing extensions to Visual Studio. I happen to like this one http://visualstudiogallery.msdn.microsoft.com/B08B0375-139E-41D7-AF9B-FAEE50F68392 by Matt Manela. Once it's installed, you can right-click a block of code and make it into a snippet. You can also set up replacements just like when you do an if or for block with the built-in snippets.

Why can't I add a subfolder in a F# project?

In most .NET project I can use folder to organise the code files. In C++, I can't, but filters end up playing the same role. However, in F# with Visual Studio 2010, I can't. Every code file is shown directly in the project dir. Why is this feature not available?
And what is the optimal strategy for organizing a project with a lot of files?
Actually, you can add folders to F# projects but it's not supported directly through Visual Studio (you have to edit the project file yourself): http://fsprojectextender.codeplex.com/ (edit: old link was broken, updated to F# Project Extender home page which has links to the original blog posts which were moved) (which I found in this answer).
I do this myself, but it is cumbersome and you end up avoiding it until keeping sanity really demands it. I think the feature simply slipped, or perhaps there wasn't as much a culture for folder organization with the F# designers in the first place. You can see in the F# source code that they favor huge source files with no directories, with separate projects as an organization boundary.
I imagine the F# project template could be modified to support this, and it is certainly something I'd like to see happen. At the same time the linear compilation order F# enforces causes your code to be somewhat self-organized, and so folder grouping plays a less significant role.
Manually editing the .fsproj file as described in Stephen's answer is one option (and I used it when I wanted to organize one larger project).
However, you have to be a bit careful and I think you cannot add new files to the folders (creating a file by hand and then adding an existing file works). However, if you like to keep things organized (like I do), then it should work for you.
Additionally, there is also a tool called F# Project Extender that should make things a bit easier for you . I have not tried it yet, but it looks like it supports adding folders (and perhaps other useful things). See for example this blog post by the project author.

How to store reusable code in Visual Studio 2010?

Is there any way I could save my block of code in Visual Studio 2010 and reuse it in my future web applications without having to "Add existing files"? Is there a feature in VS2010 that lets you globally store these blocks of code?
Thanks!
Oded pretty much covered it but I'll just reiterate here. There are three main ways you can do this depending on how much code you want to store.
For a little code just copy the code to your Toolbox:
Link
For a little code to very large blocks of code (with some intelligence for putting in values) you can use code snippets:
http://blogs.msdn.com/b/zainnab/archive/tags/tips+and+tricks/snippet/
And for lots of custom files, resources, etc... that essentially make up a new project you should use project templates:
Link
Visual Studio has a feature called code snippets, which will allow you to do exactly that.
If you want a more advanced use - for whole files, sets of files and even whole projects, use templates.

Is there a 'scratch pad' window in Visual Studio

I currently use notepad to store little notes to myself about my code.
This is usually a mixture of code and requirements.
Is there a 'scratch pad' type window in VS where i could do this.
The other alternative is to use code comment blocks in the source files, but that's not quite what I'm looking for.
Try the sticky notes add in
http://www.davidhayden.com/blog/dave/archive/2008/03/18/VisualStudio2008AddInStickyNotes.aspx
http://code.msdn.microsoft.com/StickyNotes
On "Solution Level" you can add files (text, html or code) to act as notes files.
Also in projects, you can add files, and set the Build Action to None.
Most of the time I'd simply add a .txt file to the solution or abuse comments to do it. However, if you use the scratch pad to store todo lists et cetera you can use TODO: in your comments and visual studio will add them to the built in todo list.
I just found that visual studio has support for git style .md or markdown:
This provides good way of storing notes, requirements and developer instructions such as a readme.
To use: Just add a file to your solution with a .md extension.
I think Stick notes wont support VS 2005. Anyway WinDBG rocks.

Resources