A Visual Studio extension for formatted copying of code snippets
C#
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Doc
Installer Package Release (vsix)
Source
.gitignore
LICENSE
README.md

README.md

CopyForReview

CopyForReview is a Visual Studio Extension that allows to copy code with a formatting. It removes unecessary whitespace, adds file, class, method and line info, suitable for sharing code or writing code reviews. Five output formats are currently supported: Text, Send via Email, Stack Overflow Markdown, Foswiki Markup and a customizable formatter.

How to use it

  1. Select code
  2. Press CTRL+R, CTRL+C
  3. Select the format (output goes to the clipboard)
  4. Paste

Install it directly from the Visual Studio Gallery.

Custom template format

The templates use the liquid markup. The default custom formatter shows how you can use the various supported fields:

  • DeindentedSelectedText The selected text, with the indentation removed as much as possible.

  • FullFilename The the full filename, with path and extension.

  • Filename The filename, without path.

  • LineNumberTop The line number of the topmost line.

  • LineNumberBottom The line number of the bottommost line.

  • FullClassname The fully qualified class name where the snippet is in (if any).

  • Methodname The method name where the snippet is in (if any).

  • Lines The individual code lines of the snippet.

  • DeindentedLines The individual code lines of the snippet with the indentation removed as much as possible.

  • SelectedText The selected text.

  • FileExtension The file extension.

Feedback is highly welcome. Please email to marcel@codeministry.ch. Contribute, review, comment on GitHub.