MagicStack / MagicStack/MagicPython

Getting invalid.illegal.name.python on valid python code from textmate

オープン
#252 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
1.4k
フォーク
98
PR マージ指標
30日以内にマージされた PR はありません

説明

* **Editor name and version**: VS Code 1.67
* **Platform**: all
* **Color scheme**: all
* **MagicPython version**: commit c9b3409deb69acec31bbf7913830e93a046b30cc
* **A sreenshot**:
![image](https://user-images.githubusercontent.com/38270282/172645134-50114cbe-6480-4c34-b956-4544fbdcbc2b.png)

* **5-10 lines of surrounding code**:
```python
print(42and 2)
```

in `42and 2`, a valid python code, `42and` is marked as `invalid.illegal.name.python`

`42` should be marked as `constant.numeric.dec.python` and `and` should be marked as `keyword.control.flow.python`.

PyCharm is able to parse it correctly:
image

Originally from @Bobronium in https://github.com/microsoft/vscode/issues/150199

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Reproduce the reported case in the MagicPython syntax highlighter using `print(42and 2)` in VS Code 1.67. Inspect the Python grammar responsible for numeric literals, names, and flow-control keywords; done means `42` is `constant.numeric.dec.python` and `and` is `keyword.control.flow.python`, without the illegal-name scope.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, python
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。