rory.ap
rory.ap

Reputation: 35280

Expanding multi-line snippet adds extra line at the bottom

Is there any way to prevent the addition of an extra line below a multi-line snippet in VB.NET?

enter image description here

(hit tab key to expand snippet...)

enter image description here

I've double checked that the snippet itself does not have an extra line at the end. Also, this seems to be VB-specific.

Upvotes: 14

Views: 335

Answers (1)

Horitsu
Horitsu

Reputation: 271

Just close the ]] after the end of your snipped. The ¿end¿ part sets the caret at this position after inserting the snipped.

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets 
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>tryt</Title>
      <Author>[USERNAME]</Author>
      <Description>
      </Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>tryt</Shortcut>
    </Header>
    <Snippet>
      <Code Language="vb" Delimiter="¿"><![CDATA[Try

            ¿end¿

        Catch ex As Exception
            Throw New Exception(ex) 'or do some other stuff
        End Try]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>

Upvotes: 1

Related Questions