Skip to content

Syntax Highlighting - While loop EOL comment highlighting situationally incorrect. #78

@psmskelton

Description

@psmskelton

Describe the bug
Syntax highlighting has a few quirky bugs. One I've come across in dealing with other people's code (shudder) is EOL comments on while loops. These only appear to be highlighted if they are preceded by a semicolon, which isn't great.

To Reproduce
Try something bad, like putting EOL comments on while loops. That being said, GitHub's Linguist model is completely broken for comments in MATLAB code, as this demonstrates, so look at the VSCode screenshot below.

    while test % test
        % test
    end
    
    while (test) % test
        % test
    end
    
    while test; % test
        % test
    end

    for i = 1:10 % test
        % test
    end

    if i == 10 % test
        % test
    end

Expected behavior
Consistent highlighting of EOL comments.

Screenshots
Screenshot 2024-03-07 095739

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions