mathworks / mathworks/MATLAB-extension-for-vscode

Toggle block comment (Shift+Alt+A) nests comments instead of toggling

Open
#66 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
435
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When block comments are toggled using Shift+Alt+A, existing block comments are never removed, only added, effectively nesting the block comments.

To Reproduce
Steps to reproduce the behavior:

  1. In a MATLAB file, type x = 1
  2. Select x = 1
  3. Type Shift+Alt+A multiple times

This will result in a structure like the following:

%{
%{
 x = 3 
%}
%}

Expected behavior
The first time block comments are toggled, it should insert the block comment. The second time it is toggled, the existing block comment should be removed.

Useful Information

  • OS Version: Windows 11
  • VS Code Version: 1.83.1
  • MATLAB extension version: 1.1.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Shift+Alt+A block-comment command in the MATLAB VS Code extension and reproduce it in a MATLAB file with a selected line. Done means toggling once inserts the block comment and toggling again removes the existing block comment instead of nesting it.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.