Closed MCEmperor closed 3 years ago
Please answer the following questions:
Meanwhile, this is expected as the extension has no support for embedded tab characters, so a tab character is treated as one character
Not sure if this is the case, but I think it should: is the following setting taken into account when considering the position (both for free/fixed-form reference-format recognition and for syntax highlighting)?
// The number of spaces a tab is equal to. This setting is overridden
// based on the file contents when `editor.detectIndentation` is true.
"editor.tabSize": 4,
@GitMensch - thank you for the learned comments, I think I know what should or should not do, thank you
@GitMensch - fyi, in the example, the source format detection is correct, the left-hand margin is displayed wrong due to the presence of the tabs, when the "tabbed" lines are moved into the first couple of lines, it identifies it as variable format and the margin is not shown, giving the perspective that the detection is correct but it is in fact not.
Making the source format understanding tabs will not affect this issue.
The fix, is to ensure no margin is shown if the line includes a tab character on a line-by-line basis.
I see - starting with a "real" tab makes it a variable-length line (for the internal syntax-highlighting margin). Thanks for the explanation.
Yes, I can happily report that the problem has disappeared. Thanks for fixing.
Describe the bug The syntax highlighting is messed up with certain program structures. In fixed format, in combination with a tab used as indentation to 'skip' the sequence number area, parts of keywords are colored grey (the comment color).
To reproduce
Copy the following snippet to a file.
For visibility reasons, I have marked the spaces with
·
and the tabs with→
.·
) by a space.Screenshot
The weird thing is, if we remove a newline preceding the
procedure division
, then the issue disappears, and the code is highlighted correctly.With the same code as above, if we type an asterisk in the indicator area on the line immediately preceding
procedure division
, the problem disappears:However, if we start writing a comment text behind the asterisk, then the issue reappears:
This problem has been introduced since version 7.6.6 (in 7.6.5, the problem was not there). This means that the changes by commit b3d6c4dffc958d2 has broken something.
System My COBOL related settings are as follows: