Skip to content

Commit

Permalink
Convert remaining batch of *.fnl files
Browse files Browse the repository at this point in the history
  • Loading branch information
russtoku committed Sep 3, 2024
1 parent 1979dac commit 6782532
Show file tree
Hide file tree
Showing 31 changed files with 109 additions and 211 deletions.
62 changes: 0 additions & 62 deletions fnl/conjure-spec/client/clojure/nrepl/action_spec.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -21,65 +21,3 @@
(it "deftest form with metadata"
(fn []
(assert.are.equals "foo" (action.extract-test-name-from-form "(deftest ^:kaocha/skip foo :xyz)"))))))))

;;;;;;;;;;;;;;;;;;;;
(comment

(local parse (require :conjure.client.clojure.nrepl.parse))
(local str (require :conjure.aniseed.string))
(local a (require :conjure.aniseed.core))
(local text (require :conjure.text))
(local config (require :conjure.config))


(parse.strip-meta "(deftest foo (+ 10 20))")
(str.split (parse.strip-meta "(deftest foo (+ 10 20))") "%s+") ; ["(deftest" "foo" "(+" "10" "20))"]
(r (str.split (parse.strip-meta "(deftest foo (+ 10 20))") "%s+")) ; "foo"

(parse.strip-meta "( deftest foo (+ 10 20))")
(str.split (parse.strip-meta "( deftest foo (+ 10 20))") "%s+") ; ["(" "deftest" "foo" "(+" "10" "20))"]
(r (str.split (parse.strip-meta "( deftest foo (+ 10 20))") "%s+")) ; "("

(parse.strip-meta "(deftest ^:kaocha/skip foo :xyz)")
(str.split (parse.strip-meta "(deftest ^:kaocha/skip foo :xyz)") "%s+") ; ["(deftest" "foo" ":xyz)"]
(r (str.split (parse.strip-meta "(deftest ^:kaocha/skip foo :xyz)") "%s+")) ; "foo"

;;; Expected Clojure config
(local cfg (config.get-in-fn [:client :clojure :nrepl]))

(cfg [:connection :port_number]) ; nil

;; g:conjure#client#clojure#nrepl#test#current_form_names
(cfg [:test :current_form_names]) ; ["deftest"]

;; g:conjure#client#clojure#nrepl#test#runner
(cfg [:test :runner]) ; "clojure"

;; g:conjure#client#clojure#nrepl#test#raw_out
(cfg [:test :raw_out]) ; false

;; print(vim.g["conjure#client#clojure#nrepl#test#current_form_names"])
(. vim.g "conjure#client#clojure#nrepl#test#current_form_names") ; ["deftest"]

(cfg [:test :current_form_names]) ; ["deftest"]

;; Create config items with [:test :current_form_names] for clojure client.
(set vim.g.conjure#client#clojure#nrepl#test#current_form_names [:deftest])


(fn r [words]
;; return first truthy result of applying fn to each word in words
(var seen-deftest? false)
(a.some
(fn [part]
(if
(a.some (fn [config-current-form-name]
(text.ends-with part config-current-form-name))
(cfg [:test :current_form_names]))
(do (set seen-deftest? true) false)

seen-deftest?
part)) words))


)
1 change: 0 additions & 1 deletion fnl/conjure-spec/client/clojure/nrepl/auto-repl_spec.fnl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(local {: describe : it} (require :plenary.busted))
(local assert (require :luassert.assert))
(local a (require :nfnl.core))
(local auto-repl (require :conjure.client.clojure.nrepl.auto-repl))

(describe "client.clojure.nrepl.auto-repl"
Expand Down
1 change: 0 additions & 1 deletion fnl/conjure-spec/client/clojure/nrepl/init_spec.fnl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(local {: describe : it} (require :plenary.busted))
(local assert (require :luassert.assert))
(local a (require :nfnl.core))
(local clj (require :conjure.client.clojure.nrepl))

(describe "client.clojure.nrepl.init"
Expand Down
6 changes: 1 addition & 5 deletions fnl/conjure-spec/remote/transport/elisp_spec.fnl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
(local {: describe : it} (require :plenary.busted))
(local assert (require :luassert.assert))

(local a (require :nfnl.core))
(local elisp (require :conjure.remote.transport.elisp))

(describe "remote.transport.elisp"
Expand Down Expand Up @@ -39,6 +37,4 @@
"Contents: " ["newline"]
" " ["value" "a" 1] " = " ["value" "1" 2] ["newline"]
" " ["value" "b" 3] " = " ["value" "2" 4] ["newline"]]
(elisp.read "(\"Class\" \": \" (:value \"clojure.lang.PersistentArrayMap\" 0) (:newline) \"Contents: \" (:newline) \" \" (:value \"a\" 1) \" = \" (:value \"1\" 2) (:newline) \" \" (:value \"b\" 3) \" = \" (:value \"2\" 4) (:newline))"))))
))
))
(elisp.read "(\"Class\" \": \" (:value \"clojure.lang.PersistentArrayMap\" 0) (:newline) \"Contents: \" (:newline) \" \" (:value \"a\" 1) \" = \" (:value \"1\" 2) (:newline) \" \" (:value \"b\" 3) \" = \" (:value \"2\" 4) (:newline))"))))))))
51 changes: 24 additions & 27 deletions fnl/conjure/client/clojure/nrepl/action.fnl
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
(local autoload (require :nfnl.autoload))
(local a (autoload :conjure.aniseed.core))
(local auto-repl (autoload :conjure.client.clojure.nrepl.auto-repl))
(local client (autoload :conjure.client))
(local config (autoload :conjure.config))
(local editor (autoload :conjure.editor))
(local eval (autoload :conjure.aniseed.eval))
(local extract (autoload :conjure.extract))
(local fs (autoload :conjure.fs))
(local hook (autoload :conjure.hook))
Expand All @@ -14,7 +12,6 @@
(local nvim (autoload :conjure.aniseed.nvim))
(local parse (autoload :conjure.client.clojure.nrepl.parse))
(local server (autoload :conjure.client.clojure.nrepl.server))
(local state (autoload :conjure.client.clojure.nrepl.state))
(local str (autoload :conjure.aniseed.string))
(local text (autoload :conjure.text))
(local ui (autoload :conjure.client.clojure.nrepl.ui))
Expand Down Expand Up @@ -697,40 +694,40 @@
(fn [conn]
(server.send {:op :out-unsubscribe}))))

{: passive-ns-require
: connect-port-file
{: clone-current-session
: clone-fresh-session
: close-all-sessions
: close-current-session
: completions
: connect-host-port
: eval-str
: doc-str
: connect-port-file
: def-str
: display-sessions
: doc-str
: escape-backslashes
: eval-file
: eval-str
: extract-test-name-from-form
: interrupt
: last-exception
: next-session
: out-subscribe
: out-unsubscribe
: passive-ns-require
: piggieback
: prev-session
: refresh-all
: refresh-changed
: refresh-clear
: result-1
: result-2
: result-3
: view-tap
: view-source
: clone-current-session
: clone-fresh-session
: close-current-session
: display-sessions
: close-all-sessions
: next-session
: prev-session
: select-session-interactive
: test-runners
: run-all-tests
: run-current-ns-tests
: run-alternate-ns-tests
: extract-test-name-from-form
: run-current-ns-tests
: run-current-test
: refresh-changed
: refresh-all
: refresh-clear
: select-session-interactive
: shadow-select
: piggieback
: completions
: out-subscribe
: out-unsubscribe}
: test-runners
: view-source
: view-tap}
13 changes: 5 additions & 8 deletions fnl/conjure/client/clojure/nrepl/auto-repl.fnl
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
(local {: autoload} (require :nfnl.module))
(local str (autoload :conjure.aniseed.string))
(local nvim (autoload :conjure.aniseed.nvim))
(local a (autoload :conjure.aniseed.core))
(local process (autoload :conjure.process))
(local log (autoload :conjure.log))
(local config (autoload :conjure.config))
(local client (autoload :conjure.client))
(local config (autoload :conjure.config))
(local log (autoload :conjure.log))
(local nvim (autoload :conjure.aniseed.nvim))
(local process (autoload :conjure.process))
(local state (autoload :conjure.client.clojure.nrepl.state))

(local cfg (config.get-in-fn [:client :clojure :nrepl]))
Expand Down Expand Up @@ -53,6 +52,4 @@
(log.append [(.. "; Starting auto-repl: " cmd)])
proc))))

{: enportify
: delete-auto-repl-port-file
: upsert-auto-repl-proc}
{: delete-auto-repl-port-file : enportify : upsert-auto-repl-proc}
1 change: 0 additions & 1 deletion fnl/conjure/client/clojure/nrepl/debugger.fnl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(local autoload (require :nfnl.autoload))
(local a (autoload :conjure.aniseed.core))
(local client (autoload :conjure.client))
(local elisp (autoload :conjure.remote.transport.elisp))
(local extract (autoload :conjure.extract))
(local log (autoload :conjure.log))
Expand Down
33 changes: 15 additions & 18 deletions fnl/conjure/client/clojure/nrepl/init.fnl
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
(local {: autoload} (require :nfnl.module))
(local a (autoload :conjure.aniseed.core))
(local mapping (autoload :conjure.mapping))
(local eval (autoload :conjure.eval))
(local str (autoload :conjure.aniseed.string))
(local text (autoload :conjure.text))
(local config (autoload :conjure.config))
(local action (autoload :conjure.client.clojure.nrepl.action))
(local server (autoload :conjure.client.clojure.nrepl.server))
(local parse (autoload :conjure.client.clojure.nrepl.parse))
(local debugger (autoload :conjure.client.clojure.nrepl.debugger))
(local auto-repl (autoload :conjure.client.clojure.nrepl.auto-repl))
(local client (autoload :conjure.client))
(local util (autoload :conjure.util))
(local config (autoload :conjure.config))
(local debugger (autoload :conjure.client.clojure.nrepl.debugger))
(local mapping (autoload :conjure.mapping))
(local parse (autoload :conjure.client.clojure.nrepl.parse))
(local server (autoload :conjure.client.clojure.nrepl.server))
(local str (autoload :conjure.aniseed.string))
(local ts (autoload :conjure.tree-sitter))
(local util (autoload :conjure.util))

(local buf-suffix ".cljc")
(local comment-prefix "; ")
Expand Down Expand Up @@ -322,17 +319,17 @@
(server.disconnect))

{: buf-suffix
: comment-prefix
: form-node?
: symbol-node?
: comment-node?
: comment-prefix
: completions
: connect
: context
: def-str
: doc-str
: eval-file
: eval-str
: doc-str
: def-str
: completions
: connect
: form-node?
: on-exit
: on-filetype
: on-load
: on-exit}
: symbol-node?}
2 changes: 1 addition & 1 deletion fnl/conjure/client/clojure/nrepl/ui.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
(when cb
(cb))))

{: display-result : display-sessions}
{: display-result : display-sessions }
21 changes: 10 additions & 11 deletions fnl/conjure/client/janet/netrepl.fnl
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
(local {: autoload} (require :nfnl.module))
(local a (autoload :conjure.aniseed.core))
(local bridge (autoload :conjure.bridge))
(local mapping (autoload :conjure.mapping))
(local text (autoload :conjure.text))
(local log (autoload :conjure.log))
(local config (autoload :conjure.config))
(local client (autoload :conjure.client))
(local config (autoload :conjure.config))
(local log (autoload :conjure.log))
(local mapping (autoload :conjure.mapping))
(local remote (autoload :conjure.remote.netrepl))
(local text (autoload :conjure.text))
(local ts (autoload :conjure.tree-sitter))

(local buf-suffix ".janet")
Expand Down Expand Up @@ -147,14 +146,14 @@
(disconnect))

{: buf-suffix
: comment-prefix
: form-node?
: comment-node?
: disconnect
: comment-prefix
: connect
: eval-str
: disconnect
: doc-str
: eval-file
: eval-str
: form-node?
: on-exit
: on-filetype
: on-load
: on-exit}
: on-load}
9 changes: 4 additions & 5 deletions fnl/conjure/client/rust/evcxr.fnl
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
(local {: autoload} (require :nfnl.module))
(local a (autoload :conjure.aniseed.core))
(local promise (autoload :conjure.promise))
(local str (autoload :conjure.aniseed.string))
(local stdio (autoload :conjure.remote.stdio))
(local log (autoload :conjure.log))
(local config (autoload :conjure.config))
(local client (autoload :conjure.client))
(local config (autoload :conjure.config))
(local log (autoload :conjure.log))
(local stdio (autoload :conjure.remote.stdio))
(local str (autoload :conjure.aniseed.string))

(local buf-suffix ".rs")
(local comment-prefix "// ")
Expand Down
6 changes: 3 additions & 3 deletions fnl/conjure/remote/netrepl.fnl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(local {: autoload} (require :nfnl.module))
(local a (autoload :conjure.aniseed.core))
(local net (autoload :conjure.net))
(local log (autoload :conjure.log))
(local client (autoload :conjure.client))
(local log (autoload :conjure.log))
(local net (autoload :conjure.net))
(local trn (autoload :conjure.remote.transport.netrepl))

(fn send [conn msg cb prompt?]
Expand Down Expand Up @@ -68,4 +68,4 @@
; (send c "{:hello :world}" a.println)
; (c.destroy)

{: send : connect}
{: connect : send}
11 changes: 4 additions & 7 deletions fnl/conjure/remote/nrepl.fnl
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
(local {: autoload} (require :nfnl.module))
(local a (autoload :conjure.aniseed.core))
(local bencode (autoload :conjure.remote.transport.bencode))
(local client (autoload :conjure.client))
(local log (autoload :conjure.log))
(local net (autoload :conjure.net))
(local timer (autoload :conjure.timer))
(local uuid (autoload :conjure.uuid))
(local log (autoload :conjure.log))
(local client (autoload :conjure.client))
(local bencode (autoload :conjure.remote.transport.bencode))

(fn with-all-msgs-fn [cb]
(let [acc []]
Expand Down Expand Up @@ -124,6 +123,4 @@

conn))

{: with-all-msgs-fn
: enrich-status
: connect}
{: connect : enrich-status : with-all-msgs-fn}
8 changes: 4 additions & 4 deletions fnl/conjure/remote/socket.fnl
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
(local {: autoload} (require :nfnl.module))
(local a (autoload :conjure.aniseed.core))
(local nvim (autoload :conjure.aniseed.nvim))
(local str (autoload :conjure.aniseed.string))
(local client (autoload :conjure.client))
(local text (autoload :conjure.text))
(local log (autoload :conjure.log))
(local str (autoload :conjure.aniseed.string))
(local text (autoload :conjure.text))

(local uv vim.loop)

Expand Down Expand Up @@ -108,7 +107,8 @@
(fn [err chunk]
(on-output err chunk)))))))))

(nvim.err_writeln (.. *module-name* ": No pipename specified")))
;(nvim.err_writeln (.. *module-name* ": No pipename specified")))
(vim.api.nvim_err_writeln (.. :conjure.remote.socket ": No pipename specified")))

(a.merge!
repl
Expand Down
2 changes: 1 addition & 1 deletion fnl/conjure/remote/transport/elisp.fnl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(local {: autoload} (require :nfnl.module))
(local a (autoload :conjure.aniseed.core))
(local stack (autoload :conjure.stack))
(local str (autoload :conjure.aniseed.string))
(local text (autoload :conjure.text))
(local stack (autoload :conjure.stack))

(fn err [...]
(error (str.join [*module-name* ": " ...])))
Expand Down
Loading

0 comments on commit 6782532

Please sign in to comment.