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

Fix instrument for a dot special form case #672

Merged
merged 1 commit into from
Mar 11, 2020

Conversation

Cartmanishere
Copy link
Contributor

Before submitting a PR make sure the following things have been done:

  • The commits are consistent with our contribution guidelines
  • You've added tests to cover your change(s)
  • All tests are passing
  • The new code is not generating reflection warnings
  • You've updated the README (if adding/changing middleware)

Fix for #671

Instrumentation for dot special forms of type (. clojure.lang.Numers (add 1 x)) fails. There is no breakpoint set for x.

This PR fixes this so that the breakpoints are set inside the dot special form.

@Cartmanishere Cartmanishere force-pushed the dot-fix branch 2 times, most recently from d10b4d2 to cc8d530 Compare March 9, 2020 17:57
@@ -73,7 +73,12 @@
'#{new} (cons (first args) (instrument-coll (rest args)))
'#{quote & var clojure.core/import*} args
'#{.} (list* (first args)
(second args)
(let [s (second args)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good idea to add some comments explaining this block of code.

@@ -138,6 +138,14 @@
'#{[(def foo "foo doc" (bp (bar) {:coor [3]} (bar))) []]
[(bar) [3]]})))

(deftest instrument-dot-test
(is (= (t/breakpoint-tester '(. clojure.lang.Numbers add 1 x))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good idea to wrap the tests in testing blocks with some explanations of why those cases are different.

@bbatsov
Copy link
Member

bbatsov commented Mar 10, 2020

Thanks for tackling this! I've left a couple of tiny remarks, but overall your changes look great!

@Cartmanishere
Copy link
Contributor Author

Cartmanishere commented Mar 10, 2020

Added some comments in code and tests.

@bbatsov bbatsov merged commit c754f98 into clojure-emacs:master Mar 11, 2020
@bbatsov
Copy link
Member

bbatsov commented Mar 11, 2020

Thanks!

@Cartmanishere Cartmanishere deleted the dot-fix branch March 15, 2020 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants