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
Use parser/safe-zloc-of-string #1092
Conversation
Converts all usages of `parser/zloc-of-string` to `parser/safe-zloc-of-string`. Instead of letting exceptions short-circuit, we short-circuit on nils. This keeps stack traces out of the logs. This patch also improves the performance of call hierarchies by parsing less. There's more performance work that can be done here. See comments in call_hierarchy.clj.
;; TODO: tests pass if this branch is removed. Why can't we use | ||
;; the else branch for project files? |
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.
Good question, I can't recall why I added that at the time, but if we can always get the namespace reliable and fallback for filenames when not available, seems already good enough, so the else branch makes sense.
Also, parsing the loc just to find the namespace name sounds too much
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.
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.
That makes sense! Nice
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.
LGTM
Converts all usages of
parser/zloc-of-string
toparser/safe-zloc-of-string
. Instead of letting exceptions short-circuit, we short-circuit on nils. This keeps stack traces out of the logs.This patch also improves the performance of call hierarchies by parsing less. This was just an opportunistic refactoring—while looking at the parsing done in call-hierarchy I noticed were doing it a lot more frequently than necessary. There's more performance work that can be done here. See comments in call_hierarchy.clj.
I created an issue to discuss the problem I am trying to solve or an open issue already exists.I updated documentation if applicable (docs
folder)