Custom code snippet not showing before first "using" statement
Asked Answered
F

1

6

This custom code snippet used to show up when typing CR at the top of a C# source file in Visual Studio 2013:

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Insert a Copyright notice</Title>
            <Shortcut>CR</Shortcut>
            <Description>Code snippet for the Copyright notice comment</Description>
            <Author>Pierre Arnaud</Author>
            <SnippetTypes>
              <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Code Language="csharp">
                <![CDATA[//  Copyright © 2015, EPSITEC SA, CH-1400 Yverdon-les-Bains, Switzerland$end$]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>

In Visual Studio 2015, the code snippet CR does not show up in the suggestion if I place the cursor before the first using statement. The only suggestions which show up are the two Visual Studio provided extern and using snippets.

Any idea if I have to update the XML of this snippet for this to work again?

EDIT: I opened an issue on Microsoft Connect.

Fremont answered 28/9, 2015 at 6:13 Comment(3)
So I am not the only one experiencing this issues and explains why my devs not following practice.Granthem
check here: #3957138Marva
@StefanW. I am not using ReSharper in my case...Fremont
E
1

One work around I did discover is to move the cursor to the top of the code file and then press Ctrl+K, Ctrl+S (the surround with snippet shortcut). This brings up the code snippets, including the Copyright one I have locally. This can be selected. Not a great solution but it works until a fix is in place.

Eustacia answered 24/10, 2016 at 12:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.