mathworks / MATLAB-Language-grammar

This repository contains a regular expression based language grammar for MATLAB to be used by GitHub Linguist for highlighting MATLAB code on GitHub
50 stars 17 forks source link

syntax highlighting bug #65

Open versionbayjc opened 1 year ago

versionbayjc commented 1 year ago

The following (I agree strange) code example, does not look like it is highlighted properly in VS Code with the MATLAB plugin. The Editor in MATLAB does show the highlighting correctly:

a = struct("Bla"', "bla"');

edit: adding more version details: VS Code 1.78.1 on Windows 10 22H2 Extension version: v1.0.2 Configured MATLAB in the Extension settings: R2023a Update 1

hamidingit commented 1 year ago

I am not able to reproduce this in my environment: image

my environment: VS Code: 1.78.1 on windows extension version: 1.0.2 MATLAB: 2021b

versionbayjc commented 1 year ago

That is also what I see and I think is wrong. This is what the MATLAB editor shows: image

Just to make sure: this syntax is valid and I would expect proper parenthesis matching and string highlighting. The first "bla" shows up with different colored first and last ", it's as if the single quotes and double quotes are not properly matched. The single quotes in this example are a transpose operation, not a delimiter for a char array.

dklilley commented 1 year ago

Thanks for reporting this! You are correct - this is being highlighted incorrectly, and the single quotes should instead be interpreted as transpose characters, as you stated.