Fork me on GitHub
#conjure
<
2024-02-28
>
Mark Wardle12:02:31

Apologies this is probably a silly error on my part, but I'm starting an nrepl with cider middleware and then using conjure. I can evaluate forms such (+ 1 1) without problem, but I am getting "Unresolved namespace" errors when I try to evaluate the whole buffer. New to neovim and to conjure, but in IntelliJ/cursive I'd use some kind of change namespace command.

Nundrum17:02:25

Is there an ns declaration at the top of the buffer/file?

Mark Wardle17:02:05

Yes. I can also evaluate the file without problem.

Mark Wardle17:02:45

I’ve even manually evaluated the buffer top level form at a time but get the same issue.

Nundrum17:02:44

It might be worth restarting the repl and the neovim session. It seems like something is out of sync.

Mark Wardle17:02:50

Thank you. I have tried that - and also tried my own nrepl start as well as letting conjure start one up.

Mark Wardle17:02:24

I haven’t tried disconnecting and reconnecting using :Conjure commands - I’ve quit and restarted so I’ll try that next.

Nundrum17:02:55

Good luck!

👍 1
Mark Wardle19:02:52

No luck. Refreshing namespaces gives me odd errors

Mark Wardle19:02:05

When I evaluate file, I get no error. When I evaluate buffer, I get results in the HUD for each top-level form. The def for expected-manifest has an error unresolved namespace.

Mark Wardle19:02:07

Perhaps I will backup my ~/.config/nvim and start again. I've used kickstart.nvim and then added conjure and some paredit stuff.

practicalli-johnny05:02:44

There should be no need to use a command to set the namespace when evaluating the buffer or an expression within that buffer. Conjure (like Emacs Cider) uses the current buffer namespace definition to set the context for the evaluation. Suggest confirming you can evaluate the namespace at the repl prompt to confirm the project is configured correctly. This should narrow down the cause to the Neovim setup. e.g. from the prompt in user namespace

(require '[com.eldrix.hermes.core])
If that returns without error (should return nil) then it's likely something in the Neovim setup.

practicalli-johnny05:02:45

I have been using AstroNvim very successfully with Conjure for Clojure development and the Astronvim community has a Clojure pack that includes Conjure and parinfer (see the Practicalli Astronvim-config for an example) https://practical.li/neovim/configuration/astronvim/

👍 1
Mark Wardle07:02:44

Thanks @U05254DQM - yes I can require the namespace at a REPL prompt, and it has been working using Intellij/cursive so I think I've done something wrong with my neovim/conjure set-up, or the way I'm opening my project directory. I will try with astronvim as you suggest. It feels like a glitch that might disappear through a reboot - or that I've just configured something just wrong. Thanks again.

Mark Wardle08:02:26

It worked! Actually following your steps really helped - the checkhealth step pointed out a tonne of old stuff in ~/.local which I didn't even knew existed - including packer from my previous testing of nvim - I suspect that had got into an inconsistent state in some way and so a rm -rf seems to have worked. Buffer now loading and evaluating. Thank you for your help!

👍 1