Disclaimer

The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer, Avanade.

Search
Recomends...
  • Code Complete, Second Edition
    Code Complete, Second Edition
    by Steve McConnell
Login
« Another New Feature: Code Snippet Templates | Main | Copy and Paste Code Reuse Proposal Accepted »
Thursday
Apr232009

Snip-It Pro 2.0's newest feature: Auto Commenting

Originally, I was going to wait until the weekend to implement Jeff Atwood's modest proposal for copy and paste reusibility, but I ended up doing it all last night.

I ended up calling the feature "Auto Comments," and I support four types right now:

  • Comment Snippet ID (Guid) - All new snippets are now tagged with a Guid that can be used for search purposes. When this is checked, a comment with the current snippet ID will automatically be inserted above your code snippet when you drag drag drop or copy paste from the snippet toolbar.
  • Comment Reference Url - If the snippet has a reference url and this option is enabled, a comment with that reference url will be automatically inserted.
  • Comment User - If this option is checked, the current windows user ID will be automatically inserted as a comment.
  • Comment Date - If this option is checked, the current date will automatically be inserted as a date time.

I ended up googling comments for all the languages I support. Your snippet must be categorized with a language for the comments to show up. If you choose the category: "Other" or "Text", no comments will appear.

Here's an example of an HTML snippet I drag dropped:

<!-- Snip-It Pro Snippet: 84b29e68-6769-4fbd-ad84-4a557fb565e5 -->
<!-- Inserted By SFLaptop\David -->
<!-- Inserted On Thursday, April 23, 2009 -->
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>

It automatically added the first three lines, which were not part of the snippet.

Here is a C# snippet I favorited on Snipplr: (I favorited it in Snipplr and dragged dropped from Snip-It Pro)

// Snip-It Pro Snippet: fc9c7bc0-6ace-43ef-ac80-6d6d70ea0d0d
// Reference Url: http://snipplr.com/view/4602/enum-property
// Inserted By SFLaptop\David
// Inserted On Thursday, April 23, 2009
public enum CurrActionType
 {
  view, edit, create
 }
private CurrActionType currActionType;

public CurrActionType ActionType
 {
  get
  {
   return currActionType;
  }
  set
  {
   currActionType = value;
  }
 }

Anyway, you get the idea by now.

Another related feature that Snip-It Pro always had is that if you copy code from any web page (drag to a folder or New From Clipboard) it will automatically fill out the reference url from where the snippet came from.

The beta is downloadable by clicking here.

Let me know what you think by leaving a comment or sending an email to support@snipitpro.com.

Thanks!

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments (2)

Thanks for the info
December 20, 2009 | Unregistered Commenterpatam
this is good
________________
harrison
June 5, 2010 | Unregistered CommenterBMW Cars

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.