-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Python Syntax highlighting/colors are still broken? #65713
Comments
@nchammas @aeschli @bpasero @joaomoreno Any news on this ? C++ code highlighting seems to be fine, but not Python. |
This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines. Happy Coding! |
Please report to https://github.com/Microsoft/vscode-python, with your Python extension version. |
@octref "We actually don't handle the syntax highlighting; it comes from VS Code who gets it from MagicPython." Also, in MagicPython extension it says this: "Attention VSCode users: MagicPython is used as the default Python highlighter in Visual Studio Code. Don't install it unless you want or need the cutting edge version of it. You will likely see no difference because you're already using MagicPython." Disabling all Python extensions, enabling just MagicPython, or just Python extension does not change a thing. Python syntax highlighting is still broken. Please, don't just close this, as this has been an issue for some time now and has not been resolved. |
Ok, sorry. Does this start to happen with 1.30, or sometime earlier? Can you also paste the py-imports code so I can try it? |
Thanks! I am running this:
I only started using from 1.30.1, but from previous comments/bugs, it seems this problem was there since few version back. If by py-imports code you mean some code you can copy-past into your editor, then jus tyryu what I have in the image above:
This is a basic example. It should at least highlight methods like Also this is still true: |
Try this setting: "editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "meta.function-call.generic.python",
"settings": {
"foreground": "#FF0000"
}
}
]
}, You can change the foreground to any color you want. |
@octref |
@RebelCoderRU Well, that means adding that scope to the theme-extensions https://github.com/Microsoft/vscode/tree/master/extensions. I don't know if we usually do that (the guy maintaining themes is out of office). |
But syntax color scheme selection is absolutely needed. + syntax highlighting is actually broken (if you compare to any other editor) and this has been reported countless times and always has been closed. What is the best way to go about requesting fix/addition of this? |
@RebelCoderRU Use a different theme or create your own theme |
Syntax color selection won't help much, and it's usually not a good idea because the syntax color depends largely on background, so it needs a matching theme. |
@Astrantia as it was mentioned in other closed threads on this matter, changing to any theme does not effect syntax highlighting in any way. It is always broken. I have also tried 30+ themes. No changes. @octref but changing themes still does not fix syntax highlighting issue. Try it, switch between themes and see how functions and methods are never highlighted at all. Now with your little hack it is better but still not good. So there is obviously a problem with correct syntax highlighting as there were more then 1 bug opened/closed on that matter. In Sublime Text: you can choose tons of different Syntax color themes completely separately from any other colors. In VSCode, changing theme does not change or fix syntax highlighting. I definitely think it is a bug. |
@octref I can see you have "added this to the Backlog milestone an hour ago" |
@RebelCoderRU That's because the themes you are using do not color that scope. As I said either create your own theme or edit the themes you are using. Separate ui color scheme and syntax color scheme is a completely different issue. |
Meanwhile you can take a look at https://code.visualstudio.com/api/extension-capabilities/theming for some info on theme colors vs syntax colors. |
The problem is with the scope that MagicPython uses for function references. The issue is already filed: MagicStack/MagicPython#127 |
@RebelCoderRU MagicPython does parse function calls and assigns them a separate distinct scope "meta.function-call.generic.python". It's now up to VSCode's syntax color themes to assign a color to that scope. |
Hi!
There was a bug/discussion about this before here: #1467
But reading it, I see no resolution.
VSCode's Python syntax highlighting still broken after all plugins are installed. Here is an example of Monokai themes on VSCode and Sublime:
Is/Can this be fixed at all ? I see no way to modify JUST the syntax color scheme in VSCode. Sublime and Atom do not have that problem.
No matter what theme is selected, none of the methods are highlighted.
Regards.
The text was updated successfully, but these errors were encountered: