IDLE: add a token browser
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comience con la salida de tokenize de Python y el punto de entrada de extensiones de IDLE en el menú Tools para la Shell y el editor. Revise cómo un ttk.Treeview puede representar el tipo de token, la cadena y el rango, y luego verifique el comportamiento de selección, doble clic, cursor y ámbito descrito en el issue. Se considera terminado cuando el navegador sigue la ventana actual y asigna las filas de tokens a las ubicaciones del código fuente; gh-152946 está enlazado como el PR de seguimiento.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- desktop, tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 30/100