Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Raw string highlighting #114
Comments
|
This is a feature. foo = r'\nregexp' # this is parsed as a "regexp-string"
bar = R'\nregexp' # this is parsed as a raw string |
|
Hello, I'm sorry but I can't find that difference in the CPython spec.
Please reconsider changing MagicPython behavior to be in sync with CPython. Thanks, JM |
|
Hello, I forgot to include the CPython official docs links: Thanks, JM |
You're correct—there's no "regex" literal in Python, and |
|
Hello, I understand. Thanks, JM |
|
Generally syntax highlighters don't have settings panels and aren't configurable. We had an idea how to do that for MP, but don't have time to pursue it. So unfortunately there's no ETA for this feature. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Environment data
VS Code version: 1.18.1
Python Extension version: 0.80.0
Python Version: CPython 3.5.4 32b
OS and version: Windows 7 Pro SP1 x64
Actual behavior
I have the following line
and the r and \e shows in blue with the first ' and xplorer.exe ' shows in brown(?).
My point is that it isn't recognizing it as a string (raw in this case) like it does with the previous 'SystemRoot' which shows all brown(?) and the Intellisense recognizes as a string.
Expected behavior
It should show r'\explorer.exe ' all brown(?) and recognize it as a string.
I reported this first in VS Code Python at microsoft/vscode-python#337 (comment) but Brett Cannon told me to open it here because their syntax highlighting depends on MagicPython.
Thanks,
JM