gh-152941: Add a token browser to IDLE#152946
Open
serhiy-storchaka wants to merge 1 commit into
Open
Conversation
Documentation build overview
|
terryjreedy
requested changes
Jul 3, 2026
terryjreedy
left a comment
Member
There was a problem hiding this comment.
Don't make this an extension. See issue.
|
When you're done making the requested changes, leave the comment: |
Add a Token Browser command to a new Browse menu (Shell and editor). It opens a window listing the Python tokens of the editor content, or of the selection if there is one, with the token type names colored as by "python -m tokenize". There is one browser per editor; invoking the command again refreshes it and selects the token at the cursor. Selecting rows highlights the matching regions in the editor and, while the browser has focus, moves the editor cursor there; selecting text or moving the cursor in the editor selects the matching rows. Double-clicking a row (or pressing Escape) hides the browser, revealing the editor at the token. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
379033e to
c1f145f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a Token Browser extension on the Tools menu (Shell and editor). It shows the output of
tokenizefor the current window in attk.Treeview, one row per token with its type, string, and range.Selecting a row highlights the corresponding source in the editor; double-clicking moves the 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.
🤖 Generated with Claude Code