microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.7k stars 769 forks source link

Syntax highlighting for PEP 695: Type Parameter Syntax #5541

Open rchiodo opened 6 months ago

rchiodo commented 6 months ago

Discussed in https://github.com/microsoft/pylance-release/discussions/5540

Originally posted by **einarwar** February 28, 2024 I recently started using python 3.12, but to my surprise the syntax highlighting for the new type parameter added in PEP 695 was white! Generally white color is used when accessing attributes/methods on `Unknown` objects. See image below: ![image](https://github.com/microsoft/pylance-release/assets/21360860/f089811a-a323-497f-8695-af587922204f) Is this color intentional or have i not set up pylance correctly?
rchiodo commented 6 months ago

See the discussion, but it looks like we don't return a separate token for this case:

image

dangotbanned commented 6 months ago

https://github.com/microsoft/pylance-release/issues/4645#issuecomment-1813073964

Since then I've been using this theme, which seems to have resolved the symptom described here.

agalazis commented 5 days ago

Any updates ? Since we all start adopting python 12 in our projects, it gets frustrating to miss on new features...

agalazis commented 4 days ago

As an update, I ended up switching from pylance to based pyright. https://marketplace.visualstudio.com/items?itemName=detachhead.basedpyright