MATLAB-extension-for-vscode icon indicating copy to clipboard operation
MATLAB-extension-for-vscode copied to clipboard

Diagnostic suppression for misaligned `classdef...end` places suppression in wrong location

Open dklilley opened this issue 1 year ago • 0 comments

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:

  1. Type the following into a MATLAB file:
classdef Foo

    end
  1. The classdef should have a warning diagnostic "squiggle"
  2. Hover on the diagnostic, click "Quick Fix...", and select "Suppress message ALIGN on this line"
  3. 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

dklilley avatar Oct 13 '23 22:10 dklilley