Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Edited Issue: Multiline comments inside blocks get dedented [1136]

$
0
0
Start with an empty block:
```
{
}
```
Move cursor right after the `{` and press Enter - the cursor will be on the newly inserted blank line, and will be properly indented (one level in) for block content. Type `/*` and press Enter. The comment is dedented:
```
{
/*

}
```
I assume that this is because the closing brace is now inside the comment, so it's not treated as a block anymore. However, typing `*/` then Enter does not restore the original indentation.

A quick fix would probably be to reformat on `*/`.

A better fix is to treat all blocks as if they were closed for smart indent / formatting. Basically, if it has an opening `{` but no closing one, assume a virtual `}` at the end of the file.

Viewing all articles
Browse latest Browse all 4630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>