Repository navigation
feat: highlight the line a Python error points at - #1709
Conversation
|
Out of scope here, but found while testing: with Skulpt, an unclosed bracket on the last line (e.g. |
c5a6c2d to
9d3b99c
Compare
9d3b99c to
9dbadaf
Compare
Students can find the failing line without counting. The line and its line number get a translucent design-system red, so the text selection still shows through, plus a solid bar on the number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers highlighting, clearing and moving in EditorPanel, the line and file Pyodide passes into errorDetails, and the highlight and theme colours end to end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9dbadaf to
b8e60bc
Compare
zetter-rpf
left a comment
There was a problem hiding this comment.
Do you think there's any way to reduce the number of browser based tests?
While it's helpful to have unit tests that are specific, because browser based tests take longer to run and maintain I wondered if all of them are worth the cost.
Seeing the error highlighted is just one part of a set of behaviour around error messages - maybe they could be combined with each other or existing tests related to errors without losing coverage?
zetter-rpf
left a comment
There was a problem hiding this comment.
I tried it out and it works great, what a great bonus feature for Friday!
Have a suggestion about tests, but I haven't looked at the existing error related tests so don't know how feasible it is.
|
Thanks @zetter-rpf Will take a look at the feedback 👍 |
b8e60bc to
e3523ae
Compare
The full filename check already prevents errors from highlighting the wrong file. Removing the Python-only guard lets other runners use the same error details contract in future.
e3523ae to
67fb9aa
Compare
Fold the highlight checks into existing runner error scenarios and leave detailed behaviour to the component tests. This keeps end-to-end coverage for both runtimes without adding extra browser runs.
Summary
Highlight the line a Python error points to, create a visual connection between the error and the code.
Changes
errorDetailswhen the error is in that.pyfile, clearing it on editcolor-mixfallbackerrorDetailserrorLineDismissedflag in ReduxHow this works
errorDetailsEditorPanelreads theerrorDetails, and if the errors file matches that tab, it sends the line number to the code mirror extension, which then adds the line decorationEditorPanelthen setserrorLineDismissedin Redux so the highlight doesn't come back when the editor is rebuilt i.e. switching tabs.Limitations
A11y
Screenshots
Right to left reading: