Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add syntax highlighting for new Python 3.10 match/case syntax #120734

Closed
ghost opened this issue Apr 7, 2021 · 7 comments
Closed

Add syntax highlighting for new Python 3.10 match/case syntax #120734

ghost opened this issue Apr 7, 2021 · 7 comments
Assignees
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@ghost
Copy link

ghost commented Apr 7, 2021

So, in python 3.10, there is match/case syntax. Currently, it is just white words(for monokai). I'd like if you add highlight for this. Thanks
image

@gjsjohnmurray
Copy link
Contributor

/extPython

@ghost
Copy link
Author

ghost commented Apr 7, 2021 via email

@gjsjohnmurray
Copy link
Contributor

@SNvMK my mistake. Pinging @alexr00 who I think may own this area.

@alexr00
Copy link
Member

alexr00 commented Apr 8, 2021

Thanks for the ping!

@SNvMK can you please provide a copy-pastable code snippet that illustrates the issue?

@alexr00 alexr00 reopened this Apr 8, 2021
@alexr00 alexr00 added info-needed Issue requires more information from poster and removed *caused-by-extension Issue identified to be caused by an extension labels Apr 8, 2021
@ghost
Copy link
Author

ghost commented Apr 11, 2021

Oh, hi again. Hm, yes, i can

a = 'world'
match a:
    case 'world':
        print('Hello!')
    case _:
        print('I dont know you!')

@alexr00
Copy link
Member

alexr00 commented Apr 12, 2021

We get our grammar for syntax highlighting from https://github.com/MagicStack/MagicPython. It looks like the grammar doesn't try to tokenize match-case, so I've opened an issue in that repo to request it: MagicStack/MagicPython#235

@alexr00 alexr00 closed this as completed Apr 12, 2021
@alexr00 alexr00 added grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream and removed info-needed Issue requires more information from poster labels Apr 12, 2021
@alexr00 alexr00 self-assigned this Apr 12, 2021
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

3 participants
@gjsjohnmurray @alexr00 and others