Solved

Code Snippets in Visual Studio 2012

Posted on 2013-01-09
6
443 Views
Last Modified: 2013-03-19
Hi Experts,

  I have the below snippet and it doesn't show up in IntelliSense!  Why?

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/CodeSnippet">
  <CodeSnippet Format="1.0.0">

    <!-- The header contains information describing the snippet. -->
    <Header>

      <!-- The Title of the snippet, this will be shown in the snippets manager. -->
      <Title>For Loop - 0 base</Title>

      <!-- The description of the snippet. -->
      <!-- <Description>Inserts an Apex Notifying Property.</Description> -->

      <!-- The author of the snippet. -->
      <!-- <Author>Dave Kerr</Author> -->

      <!-- The set of characters that must be keyed in to insert the snippet. -->
      <Shortcut>forloop0</Shortcut>

      <!-- A URL for more help. -->
      <!-- <HelpUrl>http://apex.codeplex.com</HelpUrl> -->

      <!-- The set of snippet types we're dealing with - either Expansion or -->
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>

    </Header>

    <!-- Now we have the snippet itself. -->
    <Snippet>

      <!-- Sepecify the code language and the actual snippet content. -->
      <Code Language="CSharp" Kind="any">
        <![CDATA[
        for(int index = 0; index < variable; index++) 
        {
        
        }
        
        ]]>
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>

Open in new window


It shows up in Snipet Manager:

Snippet manager
I try using it by typing forloop0, but InteliSense shows nothing!  This is a simple example, but I can save a lot of time using these if I can get it to work!

Thanks!
0
Comment
Question by:axnst2
  • 4
6 Comments
 

Author Comment

by:axnst2
ID: 38759948
I was able to access it by doing CTRL+K+X then it was under My Code Snippets!  It'll work though not sure why IntelliSense doesn't pick it up!  I'll keep this question open for a couple of days to see if anyone has better ideas!
0
 
LVL 80

Accepted Solution

by:
David Johnson, CD, MVP earned 250 total points
ID: 38760183
0
 

Author Comment

by:axnst2
ID: 38760901
Yeah that doesn't work...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
ID: 38760920
What are you typing within Intellisense? Your file appears to work for me:

Screenshot
0
 

Author Comment

by:axnst2
ID: 38767087
Yeah it doesn't do that for me....
0
 

Author Closing Comment

by:axnst2
ID: 38999265
It still doesn't work but thanks for the help!
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question