-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fix #91: Stack trace detection not working in colored console #148
Conversation
@jjohnstn would you please review/test/etc.? This sounds important enough to even justify RC2. |
What I'm wondering is if TextConsole should be extended in a way to get the "plaintext", this can then return just the normal text as a default implementation but the ansi console might return the unescaped text. |
Yes, I think that would be a good solution. In a comment to the open issue (eclipse-platform/eclipse.platform#535) I also said "And probably even better would be to implement the idea in issue eclipse-platform/eclipse.platform#539" But that would require a bigger refactoring, not enough time for it right now. Mihai |
Ok. |
@mihnita to be honest I think it then would be better to delay this to the next release... This currently is only an issue with m2e (and even there we not yet can reproduce it with default maven builds) and one can switch of colors there if required. Adding explicit ANSI escape removal to this code parts do not seem very useful and probably makes the code much more complex than it helps, e.g. this will only work for these explicit cases but not for probably others... The ANSI support is great, but adding ANSI workarounds everywhere seems not to scale well... |
I vote against inclusion into RC1 or RC2.
|
@mihnita : I believe we had tests for stack trace detection, at least you should see it from git history. |
+1 for moving to next release. |
Agreed, will wait for next release. |
Ack. Makes sense. |
@mihnita but you can already prepare PR for your "bigger refactoring" part so we can merge this early after branches are open... |
Updated, tested everything, and it is ready to merge. Notes:
TLDR: What I propose is:
|
I think we should not apply a quick-fix here as it unnecessary complicates things. The stacktraces are just one example and I think the ANSI console should best "hide" the ANSI nature that is when I copy/paste things, copy without escapes should be default and for API it should return a plain text and all else (HTML, RTF, with escapes) should be special cases one needs to explcitily trigger. |
You don't need to recreate your fork.
|
Even better is to use feature-branches instead of working on the master:
|
Created PR #174 using a feature branch. Thank you both for the detailed instructions. |
What it does
Removes the ANSI escape sequences before detecting links.
How to test
See eclipse-platform/eclipse.platform#535
The easiest way to reproduce was to create a new project and
println
the stack trace.Attached a small file reproducing the problem.
I've tested with ANSI Support enabled and disabled, and I've checked that the links work and jump at the proper line.
Author checklist
Main.java.zip