File tree 2 files changed +9
-7
lines changed
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -237,10 +237,10 @@ cljs.js/*load-fn*
237
237
(js-attrs proto))))))
238
238
239
239
(defn js-completion
240
- [text]
240
+ [mode text]
241
241
(let [parts (vec (.split text " ." ))
242
242
completing (or (last parts) " " )
243
- prefix #(str " js/" (str/join " ." (conj (vec (butlast parts)) %)))
243
+ prefix #(str ( when ( = mode :cljs ) " js/" ) (str/join " ." (conj (vec (butlast parts)) %)))
244
244
possibles (js-attrs (reduce aget js/window (butlast parts)))]
245
245
(->> possibles
246
246
(filter #(not= -1 (.indexOf % completing)))
@@ -289,10 +289,12 @@ cljs.js/*load-fn*
289
289
(filter matches? names))))))
290
290
291
291
(defn process-apropos
292
- [text]
293
- (if (zero? (.indexOf text " js/" ))
294
- (js-completion (.slice text 3 ))
295
- (cljs-completion text)))
292
+ [mode text]
293
+ (case mode
294
+ :js (js-completion mode text)
295
+ :cljs (if (zero? (.indexOf text " js/" ))
296
+ (js-completion mode (.slice text 3 ))
297
+ (cljs-completion text))))
296
298
297
299
(defn get-forms
298
300
[m]
Original file line number Diff line number Diff line change 22
22
[]
23
23
[reepl/repl
24
24
:execute #(replumb/run-repl (if (= @(rf/subscribe [:repl-mode ]) :cljs ) %1 (str " (js/eval \" " %1 " \" )" )) {:warning-as-error true } %2 )
25
- :complete-word replumb/process-apropos
25
+ :complete-word ( fn [text] ( replumb/process-apropos @( rf/subscribe [ :repl-mode ]) text))
26
26
:get-docs replumb/process-doc
27
27
:state repl-state
28
28
:show-value-opts
You can’t perform that action at this time.
0 commit comments