-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add hyperlinks of stack traces in Laravel logs #147
Conversation
} | ||
|
||
private fun buildFileHyperlinkInfo(fileUri: String): HyperlinkInfo? { | ||
var documentLine = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always a better idea to declare variables as close to their first usage as possible. Also, let's avoid using var
s when they are not needed
val documentLine = if (possibleDocumentLine != Int.MIN_VALUE) possibleDocumentLine - 1 else possibleDocumentLine
src/main/kotlin/com/intellij/ideolog/filters/LaravelStackTraceFileFilter.kt
Show resolved
Hide resolved
|
||
override fun applyFilter(line: String, entireLength: Int): Filter.Result? { | ||
val textStartOffset = entireLength - line.length | ||
val items = collectItems(textStartOffset, LINUX_MACOS_FILE_PATTERN.matcher(line)) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
items
and collectItems
are kinda too generic names, right?
|
||
override fun applyFilter(line: String, entireLength: Int): Filter.Result? { | ||
val textStartOffset = entireLength - line.length | ||
val items = collectItems(textStartOffset, LINUX_MACOS_FILE_PATTERN.matcher(line)) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance: we probably should add some kind of fast check that line is not Url to avoid checking regexps
I've added support for hyperlinks in the Laravel log stacktrace.
In the case Laravel logs, the position in the file is specified in parentheses:
While the default format expected the number after the semicolon:
The feature is tested on file URI for Windows, Linux, and MacOS.
Before:
After: