◐ Shell
clean mode source ↗

gh-131507: Add support for syntax highlighting in PyREPL by ambv · Pull Request #131562 · python/cpython

@ambv ambv mentioned this pull request

Mar 21, 2025

Wulian233

import unicodedata
import functools

from idlelib import colorizer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import functools

from idlelib import colorizer
from typing import cast, Iterator, Literal, Match, NamedTuple, Pattern, Self

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Viicos

Comment on lines +20 to +27

type ColorTag = (
Literal["KEYWORD"]
| Literal["BUILTIN"]
| Literal["COMMENT"]
| Literal["STRING"]
| Literal["DEFINITION"]
| Literal["SYNC"]
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type ColorTag = (
Literal["KEYWORD"]
| Literal["BUILTIN"]
| Literal["COMMENT"]
| Literal["STRING"]
| Literal["DEFINITION"]
| Literal["SYNC"]
)
type ColorTag = Literal["KEYWORD", "BUILTIN", "COMMENT", "STRING", "DEFINITION", "SYNC"]

@tomasr8

Here's what it looks like with the default Ubuntu dark/light themes:

The contrast of the blue color seems a bit too low for the dark theme (I had the same issue in #132126). Maybe the 'intense' variant might look better?

@ambv ambv mentioned this pull request

May 1, 2025

@ambv ambv deleted the pyrepl-syntax-highlighting branch

May 3, 2025 09:07