mathworks / mathworks/MATLAB-extension-for-vscode
Diagnostic suppression for misaligned `classdef...end` places suppression in wrong location
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 the classdef and its matching end are misaligned, attempting to suppress the resulting warning diagnostic causes the diagnostic suppression to be inserted after the end instead of after the classdef.
To Reproduce
Steps to reproduce the behavior:
- Type the following into a MATLAB file:
classdef Foo
end
- The
classdefshould have a warning diagnostic "squiggle" - Hover on the diagnostic, click "Quick Fix...", and select "Suppress message ALIGN on this line"
- This result in the following:
classdef Foo
end %#ok<ALIGN>
Expected behavior
The diagnostic suppression text should be added to the end of the same line the classdef is on.
Useful Information
- OS Version: Windows 11
- VS Code Version: 1.83.1
- MATLAB extension version: 1.1.3
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 misaligned classdef/end example in a MATLAB file and start from the VS Code Quick Fix flow for suppressing the ALIGN diagnostic. Trace where the suppression location is chosen; done when the suppression is placed on the classdef line rather than after end, while the existing Quick Fix behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- 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