-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raw string's scope error #152698
Comments
This appears to be a bug in the textmate grammar for Python. This grammar is built in to VS Code, not shipped as part of Pylance, which is correctly tokenizing and parsing raw strings. We'll need to work with the VS Code team to get this fixed. |
@Binaryify and @erictraut I am not a frequent Python user, so please correct me if I've misunderstood something, but I think this is a feature: MagicStack/MagicPython#114 (comment) (that's the repo that VS Code pulls our Python syntax highlighting grammar from). |
@alexr00 Thank you for your comment. I now come to understand that for vscode (and MagicPython) r and R are interpreted differently. I'm sorry for my ignorance. |
Environment data
Version: 1.68.1 (Universal)
Commit: 30d9c6c
Date: 2022-06-14T12:52:13.188Z
Electron: 17.4.7
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Darwin arm64 21.4.0
Code Snippet
r'paper\cell_b.png' == 'paper\\cell_b.png'
is evaluated as True in Python.Raw string has "r" before it, and it means string without backslash escape in Python. It's especially useful for handling paths in Windows.
the origin issue: Binaryify/OneDark-Pro#749
The text was updated successfully, but these errors were encountered: