0

below is the snippet code and this is not working in .cs file if i enter cwl and hit tab button twice. It is giving me Console.WriteLine(); where the cursor is in middle of the brackets. But it is not showing me the input string to enter.

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <!-- Title of the Snippet -->
      <Title>Console Write Line</Title>
      <!-- Shortcut to invoke the snippet -->
      <Shortcut>cwl</Shortcut>
      <!-- Description of the Snippet -->
      <Description>Outputs Console.WriteLine() in the code editor</Description>
    </Header>
    <Snippet>
      <Imports>
        <Import>
          <!-- Import namespaces needed for the code snippet -->
          <Namespace></Namespace>
        </Import>
      </Imports>
      <Declarations>
          <!-- Literals are parts in your code bellow, that you would want to change after invoking the snippet-->
        <Literal>
          <!-- The name of the literal in the code bellow between the $ $-->
          <ID>text</ID>
          <!-- Displayed info about that literal -->
          <ToolTip>The text that will be output on the console</ToolTip>
          <!-- Default value for the literal -->
          <Default>INPUT YOUR TEXT HERE</Default>
        </Literal>
      </Declarations>
      <Code Language="csharp">
        <![CDATA[Console.WriteLine("$text$");
    $end$]]> <!-- Write your code between the [] of CDATA-->
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>
6
  • Snippets are text, it would be helpful to put it in the question as text instead of a link.
    – Crowcoder
    Apr 11, 2021 at 11:44
  • Due to alignment errors, snippets code is not pasted in the question. The link is just image, can view clearly by anyone
    – user12624044
    Apr 11, 2021 at 11:48
  • You can correctly format xml in a question if you do it correctly. This community expects code to be given as text. I cannot copy and paste your image to try it myself in visual studio so I'm moving on.
    – Crowcoder
    Apr 11, 2021 at 11:53
  • Apologize! Unable to resolve indentation error so providing the link to download the snippet code file directly : app.box.com/s/002nqykt79wwnfha72ule5vawvp4i1pb
    – user12624044
    Apr 11, 2021 at 12:59
  • The file you provided does not match what shows in the screenshot. When I use the code as shown in the screenshot it works. I think you have just made a copy/paste mistake or you have put your snippet in the wrong place, or something like that.
    – Crowcoder
    Apr 12, 2021 at 13:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.