MagicStack / MagicStack/MagicPython

Python function annotation is not working

Open
#246 0 comments 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

Hi there,

My VSCode does not work well on highlight syntax with python function annotation. Details are following:

  • Editor name and version: VSCode version 1.62.3

  • Platform: Windows 10

  • Color scheme: Any (primary using Tokyo Night theme)

  • MagicPython version: latest

  • A sreenshot:
    image

  • 5-10 lines of surrounding code:

def gcd(a: int, b: int) -> int:
    if a == b:
        return a
    else:
        if a > b:
            return gcd(a-b, b)
        else:
            return gcd(a, b-a)


def gcd2(a: int, b: int):
    if b == 0:
        return a
    else:
        return gcd2(b, a % b)

Any ideas?

Thanks

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

No implementation file or test is named. Reproduce the report in VS Code 1.62.3 on Windows with the supplied Python snippet, then trace the syntax-highlighting grammar used by MagicPython. Done means function annotations in the example receive the expected highlighting without regressing the surrounding function syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python, vscode
Domain
tooling
Issue type
Bug
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.