-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch stackoverflow errors in the highlighter #19836
Conversation
There is a failure in SBT tests. It seems to originate from Scaladoc:
Trying to re-run. |
FYI: We have fixed this issue before the repo transfer (See #19884). You might consider rebasing this PR if you have this issue again (they were rare at the time) |
Thanks @hamzaremmal. @Valentin889 can you please rebase this PR on |
@mbovel PR is already green (you started a second attempt). I don't think the rebasing is necessary. |
Ah, great, then we just need an independent review 😄 @sjrd could please have a look? |
what about #19893 , could this be broadened a bit to improve the situation there too? it's a highlighting crash that isn't an SOE |
I don't know, catching stack overflows was already subject to debate, and catching more errors sound dangerous to me because we probably don't want to silence too many errors automatically. #19893 might be a bug that needs a separate fix, and we wouldn't have gotten a report for it if the error had been caught. |
compiler/src/dotty/tools/dotc/printing/SyntaxHighlighting.scala
Outdated
Show resolved
Hide resolved
Co-authored-by: Sébastien Doeraene <[email protected]>
Co-authored-by: Matt Bovel <[email protected]> Co-authored-by: Sébastien Doeraene <[email protected]> [Cherry-picked ff6ef73]
Backports #19836 to the LTS branch. PR submitted by the release tooling. [skip ci]
StackOverflow Exception on Highlight
Fixes #18596 and fixes #16904.
When there is too much instruction the Sytax Hyghlight can't make the tree and launch a StackOverflow Error
To fix the problem let's catch the Overflow and return the entry string with an error message
the lines that can triggers the error :
To fix it, let's put the try on everything starting from those lines and the catch in the end
There is no obvious need of an error message, the command and result will simply not be highlighted so I choose to not put one there.