Skip to content

Instantly share code, notes, and snippets.

@schmich
Last active July 8, 2022 11:34
Show Gist options
  • Save schmich/45ab9181ab83fb74deca to your computer and use it in GitHub Desktop.
Save schmich/45ab9181ab83fb74deca to your computer and use it in GitHub Desktop.
Visual Studio snippet to insert Debug.WriteLine with dw
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>dw</Title>
<Shortcut>dw</Shortcut>
<Description>Code snippet for Debug.WriteLine</Description>
<Author>Chris Schmich</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>System.Diagnostics</Namespace>
</Import>
</Imports>
<Declarations>
<Literal Editable="false">
<ID>Debug</ID>
<Function>SimpleTypeName(Debug)</Function>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[$Debug$.WriteLine($end$);]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
@gt4dev
Copy link

gt4dev commented Mar 12, 2020

On my VS2019 it doesn't work.

@mathaou
Copy link

mathaou commented Mar 18, 2020

On my VS2019 it doesn't work.

Works fine for me. Save it in a .snippet file and select to import it to My Snippets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment