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.
```
{
}
```
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.