microbit-foundation / python-editor-v3

Micro:bit Educational Foundation Python Editor V3
https://python.microbit.org
MIT License
57 stars 36 forks source link

Structure highlighting: don't ask for line information past EOF #1061

Closed microbit-matt-hillsdon closed 1 year ago

microbit-matt-hillsdon commented 1 year ago

Closes https://github.com/microbit-foundation/python-editor-v3/issues/1060

Can be reproduced with if True:pass at EOF and, importantly, outside the viewport (so prepended with blank lines, for example).

Also changes the highlighting in this case, see before/after images on #1060.

github-actions[bot] commented 1 year ago

Preview build will be at https://review-python-editor-v3.microbit.org/fix-1060/

microbit-matt-hillsdon commented 1 year ago

I think this fix is fine but I'd like to look more carefully at what we do with single line bodies. There's code that looks like it special cases them but I don't think it's functioning as intended.

microbit-matt-hillsdon commented 1 year ago

I think this fix is fine but I'd like to look more carefully at what we do with single line bodies. There's code that looks like it special cases them but I don't think it's functioning as intended.

This is now addressed.