VSCode version of HTML Nested Comments extension.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vscode
images
src
.gitattributes
.gitignore
.vscodeignore
CHANGELOG.md
LICENSE
README.md
package-lock.json
package.json
tsconfig.json
vsc-extension-quickstart.md

README.md

Visual Studio Marketplace Visual Studio Marketplace license

Nest Comments

About

If your code contains a comment, and you want to add a new comment to temporarily disable a block or portion of code, the built in commenting functionality does not actually place the comment tags in expected locations. If an existing comment is included in the content being commented out, the first instance of a --> or */ closing comment tag will end the entire comment.

This extension will convert pre-existing comments to safe characters, allowing a new block comment that includes the original comment. It also reverses the effect to uncomment the same block of code.

Features

If you need to comment out a portion of your code that includes pre-existing comments, the native commenting functionality will not comment properly or preserve your existing comments. This extension will maintain your original comments and allow you to quickly toggle comments on sections of code.

Examples

HTML Syntax

HTML example

<main>
  <div class="container">
    <h2>Hello World</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
    <!-- <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit.</p> -->
  </div>
</main>

Becomes:

<!-- <main>
  <div class="container">
    <h2>Hello World</h2>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
    <!~~ <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit.</p> ~~>
  </div>
</main> -->

CSS Syntax

CSS example

.example {
  /* display: flex; */
  transition: all 0.5s;
  /* user-select: none; */
  background: linear-gradient(to bottom, white, black);
}

Becomes:

/*.example {
  /~ display: flex; ~/
  transition: all 0.5s;
  /~ user-select: none; ~/
  background: linear-gradient(to bottom, white, black);
}*/

Usage

To trigger the extension, highlight the text that should be commented/uncommented.

Default Keybindings

  • Mac: cmd + alt + /
  • Windows: ctrl + alt + /

Extension Settings

The following file formats are supported:

  • asp
  • cfm
  • css
  • htm
  • html
  • md
  • njk
  • php
  • svg
  • vue
  • xml
  • xsl

Known Issues

None at this time 😃

Release Notes

Full release notes are available in the CHANGELOG file.