Skip to content

Commit 5375d00

Browse files
authored
Remove workaround for converting column numbers (#677)
See clojure-emacs/cider#2852
1 parent 829871c commit 5375d00

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## master (unreleased)
44

5+
### Bugs fixed
6+
7+
* Remove workaround for converting column numbers to 0-based indexing. ([Cider issue](https://github.com/clojure-emacs/cider/issues/2852))
8+
59
## 0.25.1 (2020-06-04)
610

711
### Bugs fixed

src/cider/nrepl/middleware/debug.clj

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -473,17 +473,16 @@ this map (identified by a key), and will `dissoc` it afterwards."}
473473
[& body]
474474
;; NOTE: *msg* is the message that instrumented the function,
475475
`(let [~'STATE__ {:msg ~(let [{:keys [code id file line column ns]} *msg*]
476-
(-> {:code code
477-
;; Passing clojure.lang.Namespace object
478-
;; as :original-ns breaks nREPL in bewildering
479-
;; ways.
480-
:original-id id, :original-ns (str (or ns *ns*))
481-
:file file, :line line, :column column}
482-
;; There's an nrepl bug where the column starts counting
483-
;; at 1 if it's after the first line. Since this is a
484-
;; top-level sexp, a (= col 1) is much more likely to be
485-
;; wrong than right.
486-
(update :column #(if (= % 1) 0 %))))
476+
{:code code
477+
;; Passing clojure.lang.Namespace object
478+
;; as :original-ns breaks nREPL in bewildering
479+
;; ways.
480+
;; NOTE: column numbers in the response map
481+
;; start from 1 according to Clojure.
482+
;; This is not a bug and should be converted to
483+
;; 0-based indexing by the client if necessary.
484+
:original-id id, :original-ns (str (or ns *ns*))
485+
:file file, :line line, :column column})
487486
;; the coor of first form is used as the debugger session id
488487
:session-id (atom nil)
489488
:skip (atom false)

test/clj/cider/nrepl/middleware/debug_integration_test.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@
580580

581581
;; Note - if changing test/src/cider/nrepl/middleware/debug_integration_test/fn.clj, also change this:
582582
(let [msg (<-- {:line 7
583-
:column 0
583+
:column 1
584584
:debug-value "\"bar\""
585585
:coor [3 1 1]
586586
:locals [["x" "\"bar\""]]})

0 commit comments

Comments
 (0)