<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: nerdymishka</title>
    <description>The latest articles on DEV Community by nerdymishka (@michaelherndon).</description>
    <link>https://dev.to/michaelherndon</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F374106%2Fc92cd8d7-a25e-4575-bc3f-474362eeddd8.jpg</url>
      <title>DEV Community: nerdymishka</title>
      <link>https://dev.to/michaelherndon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/michaelherndon"/>
    <language>en</language>
    <item>
      <title>VSCode Property Snippet With XML Doc Comments</title>
      <dc:creator>nerdymishka</dc:creator>
      <pubDate>Mon, 31 May 2021 00:52:28 +0000</pubDate>
      <link>https://dev.to/michaelherndon/vscode-property-snippet-with-xml-doc-comments-27lg</link>
      <guid>https://dev.to/michaelherndon/vscode-property-snippet-with-xml-doc-comments-27lg</guid>
      <description>&lt;p&gt;I wanted a way to make it easier to generate C# XML code comments for properties for Visual Studio Code ("VSCode"). Working with doc comments in VSCode is painful.&lt;/p&gt;

&lt;p&gt;There is no ghost-doc extension equivelant for C# in VSCode.&lt;/p&gt;

&lt;p&gt;The closest extension for generating comments is the &lt;a href="https://marketplace.visualstudio.com/items?itemName=k--kato.docomment"&gt;docomment extension&lt;/a&gt; which is being replaced by &lt;a href="https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.23.8"&gt;omnisharp&lt;/a&gt; functionality.&lt;/p&gt;

&lt;p&gt;If you run analyzers for code documentation; constructors, properties, and other public code fragments require specific phrases and required XML elements.&lt;/p&gt;

&lt;p&gt;On windows, you can fall back to Visual Studio.  If you're running your dev-environment on Linux, using Visual Studio isn't an option.&lt;/p&gt;

&lt;p&gt;Visual Studio Code has documentation for &lt;a href="https://code.visualstudio.com/docs/editor/userdefinedsnippets"&gt;user-defined code snippets&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I found a post on how to split camel-cased words into lower-cased fragments on &lt;a href="https://stackoverflow.com/questions/67566628/how-to-convert-snippet-placeholder-from-camelcase-to-snake-case"&gt;stack overflow&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using the above, I was able to cobble together the snippets below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; 
    &lt;/span&gt;&lt;span class="nl"&gt;"prop"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"prop"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"/// &amp;lt;summary&amp;gt;Gets or sets the ${2/([A-Z][a-z]+$)|([A-Z][a-z]+)/${1:/downcase}${2:/downcase}${2:+ }/g}&amp;lt;summary&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"/// &amp;lt;value&amp;gt;Property &amp;lt;c&amp;gt;${2:property}&amp;lt;/c&amp;gt; represents ${3:description}.&amp;lt;/value&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"public ${1:type} ${2:Property} { get; set; }"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ctor-summary"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"prefix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ctor-summary"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="s2"&gt;"Initializes a new instance of the &amp;lt;see cref=&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;$TM_FILENAME_BASE&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;/&amp;gt; class."&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope this helps.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>devops</category>
      <category>vscode</category>
      <category>csharp</category>
    </item>
  </channel>
</rss>
