MagicStack / MagicPython

Cutting edge Python syntax highlighter for Sublime Text, Atom and Visual Studio Code. Used by GitHub to highlight your Python code!
MIT License
1.4k stars 90 forks source link

Support for Python PEP 677 in Python TextMate grammar #247

Open alexr00 opened 2 years ago

alexr00 commented 2 years ago

VS Code includes a TextMate grammar for Python. Draft PEP 677 introduces a new syntax for annotating callable signatures. This PEP hasn't been ratified, but it's likely to be in the near future. I recently added support for this feature in pyright (and therefore, in pylance as well). The TextMate grammar will need to be updated to accommodate this new syntax. Currently, it causes VS Code to display the -> token in red.

0e3f81e5-ff24-4f85-81ca-f1519b11088b

Originally from @erictraut in https://github.com/microsoft/vscode/issues/139393

JelleZijlstra commented 3 months ago

Note this PEP was rejected, so it probably doesn't make sense to add support to MagicPython now.