-
Notifications
You must be signed in to change notification settings - Fork 765
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
Semantic highlight is wrong for some matplotlib classes #6105
Comments
I'm unable to reproduce this and the semantic token type, modifiers, and textmate scopes on these two calls appear to be the same. Some questions for you:
|
I can reproduce it with matplotlib 3.8. The type of |
I see. It's because Here's a repro without matplotlib: from typing import Any
class Foo:
def __str__(self):
return "foo"
def returns_any() -> Any: ...
foo = Foo()
print(foo) # Has `overridden` semantic token modifier
foo = returns_any()
print(foo) # Does not have `overridden` modifier |
This issue should be by design then. The different colors are because the two prints are semantically different. Well based on the types returned by matplotlib. They would be the same once updating to a newer matplotlib. |
closing as designed. |
Given the following code
Why are the two print statement of different colors?
Pylance: v2024.6.1
VS Code: 1.91.0
The text was updated successfully, but these errors were encountered: