oakmac / vscode-parinfer

Parinfer for VS Code
MIT License
167 stars 20 forks source link

Indent Mode not formatting correctly #29

Open colonelrascals opened 6 years ago

colonelrascals commented 6 years ago

Indent Mode does not seem to recognize nested parens.

Example:

Expected output:

(defn sort-parts
  [work]
  (lazy-seq
   (loop [[part & parts] work]
     (if-let [[pivot & xs] (seq part)]
       (let [smaller? #(< % pivot)]
         (recur list*
                (filler smaller? xs)
                pivot
                (remove smaller? xs)
                parts)))
     (when-let [[x & parts] parts]
       (cons x (sort-parts parts))))))

Indent Mode output:

(defn sort-parts 
  [work]
  (lazy-seq
    (loop [[part & parts] work]
      (if-let [[pivot & xs] (seq part)]
        (let [smaller? #(< % pivot)]
          (recur list*
              (filler smaller? xs)
              pivot
              (remove smaller? xs)
              parts
            (when-let [[x & parts] parts]
              (cons x (sort-parts parts)))))))))
colonelrascals commented 6 years ago

Will update with gif of recreation