Skip to content

Commit

Permalink
Fix #4 (Gitlab issue)
Browse files Browse the repository at this point in the history
Use generated locations for `indium-debugger-here', which works for both source
files and scripts with sourcemap mappings.

* indium-debugger.el (indium-debugger-here): Use generated locations.
* test/unit/indium-debugger-test.el: Add a regression test.
  • Loading branch information
NicolasPetton committed Jul 26, 2018
1 parent 3d52b63 commit 400abbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 1 addition & 3 deletions indium-debugger.el
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,7 @@ remote source for that frame."
When the position of the point is reached, pause the execution."
(interactive)
(indium-backend-continue-to-location (indium-current-connection-backend)
(make-indium-location
:line (1- (line-number-at-pos))
:file buffer-file-name)))
(indium-script-generated-location-at-point)))

(defun indium-debugger-evaluate (expression)
"Prompt for EXPRESSION to be evaluated.
Expand Down
9 changes: 8 additions & 1 deletion test/unit/indium-debugger-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,14 @@
(with-fake-indium-connection
(spy-on 'indium-backend-resume)
(indium-debugger-resume)
(expect #'indium-backend-resume :to-have-been-called-with 'fake))))
(expect #'indium-backend-resume :to-have-been-called-with 'fake)))

(it "should call the backend when jumping to a location"
(with-fake-indium-connection
(spy-on 'indium-backend-continue-to-location)
(spy-on 'indium-script-generated-location-at-point :and-return-value 'location)
(indium-debugger-here)
(expect #'indium-backend-continue-to-location :to-have-been-called-with 'fake 'location))))

(provide 'indium-debugger-test)
;;; indium-debugger-test.el ends here

0 comments on commit 400abbd

Please sign in to comment.