mvbasic icon indicating copy to clipboard operation
mvbasic copied to clipboard

[BUG] 2.1.7 introduced formatting error

Open kpowick opened this issue 9 months ago • 2 comments

Describe the bug The 2.1.7 update has introduced at least one formatting error I've noticed. Specifically, indentation formatting ignores the STOP statement.

To Reproduce Steps to reproduce the behavior:

  1. Enter the code below
IF TRUE THEN
CRT 'TRUE'
STOP
END
  1. Save the code to activate formatting

Result with 2.1.7

IF TRUE THEN
   CRT 'TRUE'
STOP <-- Indenting ingnored
END

Expected Result

IF TRUE THEN
   CRT 'TRUE'
   STOP <-- Correct indentation (2.1.6)
END

Versions of applicable software

  • macOS 15.3.2 and 12.7.6
  • MV Basic Extension 2.1.7
  • VS Code 1.98.2

kpowick avatar Mar 29 '25 20:03 kpowick

Ok, I just discovered that this issue with formatting is due to the newly introduced setting, MVBasic.formatStructure, which defaults to True. Changing the setting to False re-established the formatting I expected.

I think that (for me) to take advantage of formatStructure, it should be updated to consider the indentation of the STOP statement.

kpowick avatar Mar 29 '25 20:03 kpowick

Would be nice to have the format to match default formatting from JED (when clicking Ctrl+V). Or at least to have an option to enable it, like MVBasic.formatStyle = "JED"

alex-vulpe avatar Jun 12 '25 13:06 alex-vulpe