-
Notifications
You must be signed in to change notification settings - Fork 764
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
Syntax highlighting does not support negative literals #6267
Comments
This is likely coming from MagicPython. Just in case this is not, moving to pylance. |
Hi, @karthiknadig thanks! Hope we can have a solution to this. |
Counts as an operator in what sense? I see that the TextMate grammar is treating it that way, but I don't think that's true from Python's perspective. Here's what I see in the Python grammar, which indicates that negative numbers are literals.
Then for fun I tried https://github.com/iritkatriel/codoscope and it also indicates that there's no operator call involved here: |
Wouldn't the UNARY_NEGATIVE be the operator? Oh I guess that was on X, but not 1. So for |
Yeah, I added the |
Reopening since this is a bug. However, @hologerry, be aware that it may not get fixed anytime soon. See #5824 for some context. |
Hi @debonte, Thanks for clarifying this! It’s great to know, and I hope we can get a better syntax highlighter in the future. |
I am using latest VS Code and Python/Pylance extension on macOS.
The color theme is the Dracula https://github.com/dracula/visual-studio-code
The minus symbol
-
is not highligted with the numbers.I suggest to add something like this -? at the begin of this regexp.
Like this: (-?[0-9]+)
A similar issue of other extension: hashicorp/vscode-terraform#243
The text was updated successfully, but these errors were encountered: