File tree Expand file tree Collapse file tree 4 files changed +404
-140
lines changed Expand file tree Collapse file tree 4 files changed +404
-140
lines changed Original file line number Diff line number Diff line change 1
1
(ns devtools.format
2
2
(:require-macros [devtools.util :refer [oget oset ocall oapply]])
3
3
(:require [devtools.prefs :refer [pref]]
4
- [devtools.munging :as munging]
5
- [clojure.string :as string]))
4
+ [devtools.munging :as munging]))
6
5
7
6
; ---------------------------------------------------------------------------------------------------------------------------
8
7
; PROTOCOL SUPPORT
186
185
187
186
(defn cljs-function-template [fn-obj]
188
187
(let [[ns name] (munging/parse-fn-info fn-obj)
189
- arities (or (munging/collect-fn-arities fn-obj) {:naked fn-obj})
190
- multi-arity? (> (count arities) 1 )
191
188
args-open-symbol (pref :args-open-symbol )
192
189
args-close-symbol (pref :args-close-symbol )
193
190
multi-arity-symbol (pref :multi-arity-symbol )
194
191
spacer-symbol (pref :spacer )
195
192
rest-symbol (pref :rest-symbol )
196
- args-lists (munging/arities-to- args-lists arities true )
197
- args-strings ( munging/ args-lists-to- strings args-lists spacer-symbol multi-arity-symbol rest-symbol )
193
+ args-strings (munging/extract- args-strings fn-obj true spacer-symbol multi-arity-symbol rest-symbol )
194
+ multi-arity? ( > ( count args-strings) 1 )
198
195
args (map #(str args-open-symbol % args-close-symbol) args-strings)
199
196
multi-arity-marker (str args-open-symbol multi-arity-symbol args-close-symbol)
200
197
args-template (template :span :fn-args-style (if multi-arity? multi-arity-marker (first args)))
You can’t perform that action at this time.
0 commit comments