This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hey. There is no Conjure-hacking channel so I'll ask here (trying some Fennel+Aniseed+Conjure). How can I create a new Clojure buffer and connect it to Conjure? For instance I have this code (it's copied from conjure school from here: https://github.com/Olical/conjure/blob/2c42367fc301f3b38d1f25a68016eec59b834c1a/fnl/conjure/school.fnl#L49):
(defn set-clojure-mode! [buffer-name]
(nvim.ex.augroup :conjure_school_filetype)
(nvim.ex.autocmd_)
(nvim.ex.autocmd (string.format "BufNewFile,BufRead %s setlocal filetype=clojure" buffer-name))
(nvim.ex.augroup :END))
(defn start-buffer! []
(set-clojure-mode! const.buf-name)
(nvim.ex.edit const.buf-name))
(comment (start-buffer!))
It correctly assigns that Clojure file type and the highlighting is picked up. But what it doesn't do is it doesn't bind to a REPL.
What I get is this in the log:
; eval (buf): /home/martin/.config/nvim/fnl/narrower/narrower1
; --------------------------------------------------------------------------------
; localhost:8794 (ECONNREFUSED): .nrepl-port
; --------------------------------------------------------------------------------
; localhost:8794 (disconnected): .nrepl-port
In all if my other Clojure projects this babashka REPL starts automatically even if I don't want it to start but here it doesn't start a REPL.
What is the rule to start it? I tried creating .git
and project.clj
files in the fnl
directory (trying to pretend this is a project).
What I want to do is to start a new buffer, then put some code into it and evaluate in a REPL.
But that REPL should be Clojure REPL from the current project and not Fennel REPL.It works if I'm in a project. But somehow it fails if I'm in fnl
directory in my nvim
config.
Is it intended that Conjure doesn't pick up weirdly named buffers?
I created this buffer out of thin air and set its mode to Clojure. Then
REPL has bound itself to it but tests can't run when I click <localleader>tt
.
Weird. Is this a bug?
I suppose this code is what executes the test but it somehow doesn't pick up anything: https://github.com/Olical/conjure/blob/d88a3c8f911b92db5bf34b3b0e7a9e10692bafcb/fnl/conjure/client/fennel/aniseed.fnl#L45
Found it. If I run function ConjureCljRunCurrentNsTests
manually then the tests are picked up.
Conjure restricts some files types to extensions by default to avoid a bug with Scheme related stuff, I can't remember the specifics. More on it in :h g:conjure#filetype_suffixes#[filetype]
.
That's only to separate Racked and Scheme though, there's no filtering for Clojure, only filetype I think.
Well I think it's only the binding. In my previous comment I wrote that if I execute ConjureCljRunCurrentNsTests
by hand then it loads the namespace. So probably this would be the same binding thing.