Skip to content
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

JavaStackTrace: Added support for package prefix #2658

Merged

Conversation

@RunDevelopment
Copy link
Member

@RunDevelopment RunDevelopment commented Nov 25, 2020

This adds support for modules in Java stack traces.

This fixes #2657.

@mAAdhaTTah
Copy link
Member

@mAAdhaTTah mAAdhaTTah commented Nov 28, 2020

Just to confirm, does this/should this match something like java.base/arrays.helpers/Collection (or some other example where / appears twice)? Is that even valid? If it's invalid should we still highlight it? Does it matter (maybe not)? Thoughts?

@RunDevelopment
Copy link
Member Author

@RunDevelopment RunDevelopment commented Nov 28, 2020

Good questions. I investigated a little: The print method of Java Throwable uses the standard toString method of StackFrameElement which is technically implementation-defined but the doc lists some examples of what you can expect. Examples like com.foo.loader/foo@9.0/com.foo.Main.run(Main.java:101), com.foo.loader/foo@9.0/com.foo.Main.run(Unknown Source), and acme@2.1/org.acme.Lib.test(Lib.java:80).

Why can't it ever be easy...

I'll fix it.

Also, I intentionally made the stack frame pattern more accepting than it has to be. This makes the pattern simpler and more robust in case I forgot a case (like I did).

@RunDevelopment RunDevelopment merged commit 0bb4f09 into PrismJS:master Nov 28, 2020
7 checks passed
@RunDevelopment RunDevelopment deleted the java-stack-trace-package-fix branch Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants