I realize that the TextMate grammar for Python ships with VS Code and the code is in the MagicPython repo, but I'm filing this here because the Pylance team is tracking a few other TextMate grammar issues.
The grammar apparently doesn't handle the case where a match (soft) keyword is followed by a ~ token.
match ~1:
case _:
pass
Note how it works correctly for other unary operators.
Repros on 2024.2.105. Note that semantic highlighting covers up this issue. You can see the coloring that Eric showed above by setting "editor.semanticHighlighting.enabled": false
I realize that the TextMate grammar for Python ships with VS Code and the code is in the MagicPython repo, but I'm filing this here because the Pylance team is tracking a few other TextMate grammar issues.
The grammar apparently doesn't handle the case where a
match
(soft) keyword is followed by a~
token.Note how it works correctly for other unary operators.