MagicStack / MagicStack/MagicPython
[Bug] Class method 'self' looses special self scope with added type annotation
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 1.4k
- フォーク
- 98
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Got send here from 'vscode-python' https://github.com/microsoft/vscode-python/issues/11593
* **Editor name and version**: VS Code version: 1.44.2
* **Platform**: Windows_NT x64 10.0.17134
* **Color scheme**: Custom (close to Monokai)
* **MagicPython version**: Dunno which vscode uses
Without type annotation everything is just fine.

When a type annotation is added to the `self` parameter the special scope for `self` is missing.

## Steps to reproduce:
Paste the following code into a *.py file and inspect the `self` parameter with the developer token inspect tool. Like in the screenshots above.
The `self` parameter of the `bad_func` should show the actual scopes and the `self` parameter of the `good_func` should show the expected scopes.
```
class Test:
def bad_func(self: Test):
pass
def good_func(self):
pass
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
再現された Python スニペットから始め、開発者向けのトークン検査ツールを使って、注釈付きおよび注釈なしの self パラメーターのトークンスコープを調べます。クラスメソッドのパラメーターを処理する構文ハイライトの経路を追跡します。完了条件は、self: Test が注釈なしの self と同じ特殊な self スコープを保持することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, python
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 35/100