python / python/cpython

IDLE: add a token browser

オープン
#152,941 コメント 9 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

stdlib topic-IDLE type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Seeing how source is split into tokens helps in learning how Python's tokenizer works and in debugging tokenizer-dependent behavior, but IDLE offers no way to inspect the token stream.

I propose a Token Browser added as an extension on the Tools menu (Shell and editor). It shows the output of tokenize for the current window in a ttk.Treeview — one row per token with its type, string, and range.

Interaction:

  • Selecting a row highlights the corresponding source in the editor.
  • Double-clicking a row moves the editor cursor to that token.
  • The browser follows the editor: a selection selects every overlapping token row, and the cursor alone selects the single token containing it.
  • Scope is the editor selection if there is one, else the Shell's current input, else the whole window.

A PR will follow.

Linked PRs
  • gh-152946

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

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

はじめの一歩

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

調査の方向性

Python の tokenize の出力と、Shell およびエディター向けの Tools メニューにある IDLE の拡張機能エントリーポイントから始めます。ttk.Treeview でトークンの種類、文字列、範囲をどのように表現できるかを確認し、その後、issue に記載された選択、ダブルクリック、カーソル、スコープの動作を検証します。ブラウザーが現在のウィンドウに追従し、トークン行をソースの位置に対応付ければ完了です。gh-152946 は後続の PR としてリンクされています。

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

評価

技術スタック
python
領域
desktop, tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
30/100

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

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