Open ujan-r opened 5 days ago
I verified examples 1 and 3 on macOS and Windows. They are specific to Shell in that only Shell gets SyntaxError messages mixed in with code to be executed. Put the same text (without the prompts*) in an IDLE code editor and the behavior is correct.
The immediate fix is that hyperparser know when it is in Shell and when so, treat the code-begin mark as beginning of file. A different fix that I have already planned it to not mix SyntaxError and new prompts into the new code area. Instead intercept it and display the message in the status bar or a popup. The latter is used (currently) for editor windows, but I have thought of changing for short messages.
I also want to replace using one Text for both history/output and code input, with a movable boundary between, and instead use different widgets for the different functions.
Bug report
Bug description:
After making a typo in IDLE, I noticed some unexpected calltips and incorrectly matched parentheses. These seem to be caused by the parser not knowing where the current prompt begins. I'll try to send in a PR tonight.
Examples
Parentheses are incorrectly matched:
Matching parentheses aren't detected (from #85560):
Calltip appears unexpectedly (Python 3.12; a new error message hides this issue in the latest version):
CPython versions tested on:
3.12, CPython main branch
Operating systems tested on:
macOS
Linked PRs