conjure

Mark Wardle 2024-02-28T12:29:31.355009Z

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.

Mark Wardle 2024-02-29T08:09:26.063229Z

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
Nundrum 2024-02-28T17:13:25.485179Z

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

Mark Wardle 2024-02-28T17:14:05.349319Z

Yes. I can also evaluate the file without problem.

Mark Wardle 2024-02-28T17:14:45.234749Z

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

Nundrum 2024-02-28T17:16:44.638699Z

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

Mark Wardle 2024-02-28T17:17:50.509089Z

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

Mark Wardle 2024-02-28T17:18:24.999669Z

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

Nundrum 2024-02-28T17:18:55.516129Z

Good luck!

👍 1
Mark Wardle 2024-02-28T19:20:52.967229Z

No luck. Refreshing namespaces gives me odd errors

Mark Wardle 2024-02-28T19:22:05.949249Z

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 Wardle 2024-02-28T19:23:07.857479Z

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

practicalli-johnny 2024-02-29T05:40:44.846679Z

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-johnny 2024-02-29T05:44:45.036139Z

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 Wardle 2024-02-29T07:45:44.702269Z

Thanks @jr0cket - 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.