File tree Expand file tree Collapse file tree 3 files changed +22
-13
lines changed Expand file tree Collapse file tree 3 files changed +22
-13
lines changed Original file line number Diff line number Diff line change 7777 (:code-channel plugin))
7878
7979(defn start
80- [{:keys [debug nvim repl-log socket-repl code-channel] :as plugin}]
80+ [{:keys [nvim repl-log socket-repl code-channel] :as plugin}]
8181
8282 ; ; Wire sub-component io.
8383 (log-start
191191 plugin))
192192
193193(defn new
194- [debug nvim repl-log socket-repl]
194+ [nvim repl-log socket-repl]
195195 {:nvim nvim
196196 :repl-log repl-log
197197 :socket-repl socket-repl
198- :debug debug
199198 :code-channel (async/chan 1024 )})
Original file line number Diff line number Diff line change 22 " The system created by wiring various components together."
33 (:require
44 [clojure.core.async :as async]
5+ [clojure.tools.logging :as log]
56 [neovim-client.nvim :as nvim]
67 [socket-repl.socket-repl-plugin :as plugin]
78 [socket-repl.repl-log :as repl-log]
89 [socket-repl.socket-repl :as socket-repl])
910 (:gen-class ))
1011
11- (defn new-system
12- [debug]
13- ; ; TODO - separate new & start in nvim
14- (let [nvim (if debug
15- (nvim/new " localhost" 7777 )
16- (nvim/new ))
17- socket-repl (socket-repl/start (socket-repl/new ))
12+ (defn new-system*
13+ [nvim]
14+ (let [socket-repl (socket-repl/start (socket-repl/new ))
1815 repl-log (repl-log/start (repl-log/new socket-repl))
19- plugin (plugin/start (plugin/new debug nvim repl-log socket-repl))]
16+ plugin (plugin/start (plugin/new nvim repl-log socket-repl))]
2017 {:nvim nvim
2118 :repl-log repl-log
2219 :socket-repl socket-repl
2320 :plugin plugin}))
2421
22+ (defn new-system
23+ ([]
24+ (log/info " starting plugin using STDIO" )
25+ (new-system* (nvim/new )))
26+ ([uds-filepath]
27+ (log/info " starting plugin using UDS" uds-filepath)
28+ (new-system* (nvim/new uds-filepath)))
29+ ([host port]
30+ (log/info (format " starting plugin using TCP socket %s:%s" host port))
31+ (new-system* (nvim/new host port))))
32+
2533(defn stop
2634 [{:keys [nvim plugin repl-log socket-repl] :as system}]
2735 (plugin/stop plugin)
3139
3240(defn -main
3341 [& args]
34- (new-system false ))
42+ (if (= 1 (count args))
43+ (new-system (first args))
44+ (new-system )))
Original file line number Diff line number Diff line change 1515(defn go
1616 " Start the plugin."
1717 []
18- (reset! system-atom (system/new-system true )))
18+ (reset! system-atom (system/new-system " localhost " 7777 )))
1919
2020(defn stop
2121 []
You can’t perform that action at this time.
0 commit comments