Scope highlighting feature in Thonny

31 views
Skip to first unread message

Pratham Sachdev

unread,
Dec 25, 2020, 11:50:47 AM12/25/20
to thonny
Hello. I would like to see a scope highlighting feature in thonny for python just like the one in BlueJ for java. 
BlueJ_Screenshot-2.png
I think it would make it easier for teachers to explain the flow of code and help beginners like me better understand the logic of program. Would like to know what everyone thinks of this feature. Thanks.

Aivar Annamaa

unread,
Dec 28, 2020, 12:02:24 PM12/28/20
to thonny
Hi!

I assume you actually meant highlighting syntactic blocks, because Python does not have so many scopes as Java (eg. if-statement does not introduce a scope).

I have something similar in mind, which does include highlighting blocks. In my vision you can put an editor into navigation mode, where you can use arrow keys for navigating inside the program tree, quite like you can move inside a tree widget -- up/down would highlight prev/next sibling node, left/right would go up/down one level. When you click somewhere, the closest surrounding block will be highlighted. With ENTER you can put the highlighted block into edit mode, where you can edit as if it was a toplevel program (ie. without dealing with indents inherited from its parents). You can go back to navigation mode with ESC.

Best regards,
Aivar

Reply all
Reply to author
Forward
0 new messages