You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When initializing a raw string variable, escape characters (backslash + char) get highlighted by default. This occurs for character arrays (using single quotes), but not for strings (using double quotes).
For example, when defining a Windows path: temp_path = '\\somedrive\path\to\right\folder\';
In this case, the escape characters \\, \r, \t, and \f characters would be highlighted.
If you do the same but with double quotations, the error does not occur. This is the expected behavior.
The text was updated successfully, but these errors were encountered:
goldrik
changed the title
Prevent highlighting of escape characters in character arrays
Escape characters are highlighted in character arrays
Jan 5, 2024
I don't think it is a bug that the escape characters are being highlighted in character vectors - they are explicitly being tokenized as constant.character.escape.matlab. It is definitely incorrect, however, that they are being treated differently between char vectors and string arrays.
I am moving this issue over to the MATLAB-Language-grammar repository, because this is an issue with the grammar.
dklilley
transferred this issue from mathworks/MATLAB-extension-for-vscode
Jan 8, 2024
Describe the bug
When initializing a raw string variable, escape characters (backslash + char) get highlighted by default. This occurs for character arrays (using single quotes), but not for strings (using double quotes).
For example, when defining a Windows path:
temp_path = '\\somedrive\path\to\right\folder\';
In this case, the escape characters
\\
,\r
,\t
, and\f
characters would be highlighted.If you do the same but with double quotations, the error does not occur. This is the expected behavior.
The text was updated successfully, but these errors were encountered: