mathworks / mathworks/MATLAB-extension-for-vscode
Incorrect auto-commenting of line continuation when % present in cell array.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 435
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When breaking long lines using a ... continuation, if the preceding line contains a %, the continued line is automatically commented.
To Reproduce
Steps to reproduce the behavior:
- Enter a line containing a
%character, such as anfprintf()call.
% The datetime call is obviously wrapped up in a function, but for reproducibility, it's dumped out here.
fprintf('%s | Test.\n', char(datetime('now', 'TimeZone', 'local', 'Format', 'yyyy-MM-dd''T''HH:mm:ss.SSSXXX')));
- Attempt a line continuation after the
%character.
fprintf('%s | Test.\n', ...
% char(datetime('now', 'TimeZone', 'local', 'Format', 'yyyy-MM-dd''T''HH:mm:ss.SSSXXX')));
Expected behavior
The continued line should not be automatically commented.
Screenshots
Useful Information
- OS Version: Microsoft Windows 11 Enterprise (10.0.22631)
- VS Code Version: 1.87.0
- MATLAB extension for Visual Studio Code Version: 1.2.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in VS Code with the MATLAB extension using the provided fprintf() example and line continuation. Start by tracing the extension behavior that automatically comments continued lines, then verify that a continuation after a % inside the example is not commented. Done means the reported reproduction no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100