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
Write a raw string with some backslashes as a function parameter:
open(r'C:\Jenkins\new-file.xml')
Observe the backslashes are incorrectly shown as being part of an escape sequence. Raw strings literals have literal backslashes, you can't write escape sequences in them. The string should be a solid colour. \n should not be highlighted as it is in a raw string, and \J should not be highlighted as it's not even an escape sequence in a normal string (normal string highlighting behaves correctly here).
Looks like GitHub highlighting gets it wrong too. :)
We highlight raw strings with Regexp syntax, that's what original users of tmLanguage schemas in TextMate and SublimeText expected. We can probably compile a special version of MagicPython that wouldn't have this feature, but then you'll get a lot of negative feedback that we broke this feature in VSCode. So as is, this isn't a bug in current MagicPython, it's a feature.
VSCode user here. Please reopen this issue. r'strings' are string literals, not the regex literals! It can be used for example for windows filesystem paths without manually changing every slash to double slash...
I know that it is used often in regex. But this feature should be handle differently. At least provide some config, to set it manually.
Snippet below doesn't looks like a feature at all.
EDIT
I've just read #149
So I can use bit R instead of r. But still...
From @akdor1154 on August 30, 2018 0:54
VSCode Insiders Version: 1.27.0-insider 47d0584301d16d4efd6618f6f33ef14099c92561 x64
VSCode Stable Version: 1.26
OS Version: ubuntu 18.04 x64
Steps to Reproduce:
Observe the backslashes are incorrectly shown as being part of an escape sequence. Raw strings literals have literal backslashes, you can't write escape sequences in them. The string should be a solid colour.
\n
should not be highlighted as it is in a raw string, and\J
should not be highlighted as it's not even an escape sequence in a normal string (normal string highlighting behaves correctly here).Looks like GitHub highlighting gets it wrong too. :)
Copied from original issue: microsoft/vscode#57555
The text was updated successfully, but these errors were encountered: