microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.72k stars 766 forks source link

Syntax highlighting for PEP 695: Type Parameter Syntax #5541

Open rchiodo opened 8 months ago

rchiodo commented 8 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 8 months ago

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

image

dangotbanned commented 8 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 2 months ago

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

agalazis commented 2 months ago

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

heejaechang commented 1 month ago

a: MyType also shows MyType as white. we should update our semantic tokenizer to support new TypeAlias at the decl and usage.