Skip to content

Toggle Line Comment in Fenced code blocks for JSONC doesn't work well in Markdown #142960

@yarakos95

Description

@yarakos95

This problem still occurs even if you disable all extensions.

Toggle Line Comment in Fenced code blocks for JSONC doesn't work well in Markdown

Toggle Line Comment in Fenced code blocks for JSONC doesn't work well in Markdown.

On the other hand, Toggle Line Comment in Fenced code blocks for JSON and JSON5 does work well.

demo

Create the following Fenced code blocks for JSONC.

```jsonc
{
  "settings": true
}
```

Then run Toggle Line Comment on the line with "settings".
You will get the following results:

```jsonc
{
  <!-- "settings": true -->
}
```

The correct result is:

```jsonc
{
  // "settings": true
}
```

GIF animation

Execute Ctrl+/ repeatedly

toggleLineCommentJSONC

Version

 Version: 1.64.1 (user setup)
  Commit: d6ee99e4c045a6716e5c653d7da8e9ae6f5a8b03
    Date: 2022-02-07T17:16:22.147Z
Electron: 13.5.2
Chromium: 91.0.4472.164
 Node.js: 14.16.0
      V8: 9.1.269.39-electron.0
      OS: Windows_NT x64 10.0.19043

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsidersmarkdownMarkdown support issuesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions