MagicStack / MagicStack/MagicPython

Support for Python PEP 677 in Python TextMate grammar

Open
#247 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.4k
Forks
98
PR merge metrics
No merged PRs in 30d

Description

* **Editor name and version**: VS Code
* **Platform**: Any
* **Color scheme**: Any
* **MagicPython version**:
* **A sreenshot**:
* **5-10 lines of surrounding code**:

VS Code includes a TextMate grammar for Python. Draft [PEP 677](https://www.python.org/dev/peps/pep-0677/) 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](https://user-images.githubusercontent.com/7040122/146594702-529223ac-336d-4e36-ba0a-8ba616aac847.jpg)

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Python TextMate grammar used for VS Code and read PEP 677 alongside the existing grammar rules. Use the callable-signature syntax described in the issue as a highlighting example; done means the new syntax, including the arrow token, is highlighted without the reported red error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.