Skip to content

[Feature Request] Distinct syntax highlighting for the 'step' argument in python slicing #319205

@spinny95-cmyk

Description

@spinny95-cmyk

When reading Python code, it can be mentally taxing to parse three consecutive integers in a slicing expression (e.g., text[0:10:2]). Currently, most color themes apply the exact same color to all numbers inside the brackets, making it hard to instantly distinguish the "range" from the "step".

It would be incredibly helpful for readability if the range (start:stop) and the step could have distinct syntax highlighting colors.

Instead of coloring all numbers equally, the theme should group them logically:

Range group (start:stop): Maintained in the standard number color.

Step group (step): Highlighted in a different color to indicate it's a modifier/option.

Example concept:
text[ 0:10: 2 ] (Where '2' has a distinct color from '0' and '10')

Currently, the only workaround is adding manual spaces like text[0:10 : 2], but a native syntax highlighting distinction would be a much cleaner and more intuitive user experience (UX) for Python developers.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions