Interactive evaluation for Neovim (Clojure, Fennel, Janet, Racket, Hy, MIT Scheme, Guile, Python and more!)
UNLICENSE License
Bot releases are hidden (Show)
Published by Olical over 5 years ago
So if you evaluated something that returned a lazy-seq that would throw when it was fully resolved it would cause an error that never displayed. This is because the error happens inside the actual internal prepl code, not inside my eval code where I try/catch. I've solved this with a doall before the pr-str which should prevent any of these in the future.
I added some more code to check for these unhandled errors in the future and log them with some information about it probably being a bug in Conjure, so you should report them if you see more!
This was raised in #33 and hopefully fixed in this patch.
Published by Olical over 5 years ago
The new compile script needed some TLC around output and using -Sforce
to fix some oddities in the first time compile.
Published by Olical over 5 years ago
I noticed some weird issues on first build of this version, I'll release a patch today that hopefully addresses them. Just
rm -rf classes target && bin/compile
if the initial compile failed for now.
Replace your call to make compile
with bin/compile
. For me that's in my call to vim-plug as documented in the readme. Here's the change I made in my dotfiles, ignore the fact that I'm using the master branch, you should be using a tag. I use master because I know what's there and am okay with it breaking sometimes.
I wanted to remove the dependency on make so I rolled my own "should I recompile?" check using modified times of the classes
directory and the latest git commit.
I originally had a kind of hacky solution to injecting compliment that involved managing a list of files to load by hand. I've now replaced that with calls to Mr Anderson to fetch and munge injected dependencies as well as tool.namespace to parse and resolve the dependency order.
This means I can grow the list of dependencies to inject into your prepl as you connect as much as I want. It'll never conflict with your existing copes of those dependencies. If you need a specific version of tools.namespace in your project but Conjure needs a newer one to do it's thing you don't have to worry: It'll just work!
Published by Olical over 5 years ago
I realised that the fix I put in for #34 was doing a bunch of unnecessary Neovim API calls. There were a few duplicate requests for information from Neovim in a few places actually.
I've basically made Conjure only ask for data it needs and not ask for things twice, this could definitely be improved by some sort of internal declarative system.
Shouldn't notice any functionality changes in this patch but it should work a lot faster as you type and eval the root form!
Published by Olical over 5 years ago
.clj
file anywhere on disk, hit <localleader>re
and have it evaluate the form under the cursor.nil
s: https://github.com/Olical/conjure/commit/f7457355a27b1decfe82f796e1ff76f9746f31e6
Published by Olical over 5 years ago
#12 is done! So errors now get pretty printed as a string, just like they do in the regular Clojure REPL. The full stack trace data structure is still printed in the log (through zprint) but it's folded. You can reveal it with zo
and close it with zc
, check out :help fold
for more information on this feature. It's built into Vim!
I also think I broke ClojureScript evals in the last patch version (SORRY) which is fixed now.
Published by Olical over 5 years ago
Just a small patch because I realised 1.10.1-beta2
can cause issues on some machines and setups. I hope it didn't break it for anyone! Also includes some internal changes in preparation for better errors, the errors are now pretty printed as strings above the stack trace too.
Also fixed a bug where really long namespace forms weren't being read correctly to set the namespace of the eval.
Published by Olical over 5 years ago
This is a fairly large set of commits but I still wanted to add more. I thought I'd cut at this known good point though.
gd
to go to definition of things you evaluated with a range, form or buffer.ClojureScript support for autocompletion and preserving def meta data will hopefully come some time soon! I hope you enjoy this release, let me know if you hit any issues!
Published by Olical over 5 years ago
A rather large block of changes this time although there's still more I want to do around completion (#16) and a test suite (#13). I've just added one "Hello, World!" test for now to get everything working in CircleCI (which is amazing btw).
,rt
and ,rT
test bindings will run the -test
variant of your namespace name if available.clojure.test/*test-out*
is a thing but only in Clojure, not ClojureScript)conjure#get_rpc_port()
will get you the port to connect to, funnily enough.Whew, and there's lots more to come! But yay, full autocomplete as you type without blocking your editor! Omnicomplete still works as normal for those of you that prefer the good old <C-x><C-o>
binding.
Published by Olical over 5 years ago
This is the beginning of test support, adds ,rt
(run tests) and ,rT
(run all tests) as part of https://github.com/Olical/conjure/issues/20. Also removed the paren guard because it broke ClojureScript in weird ways (https://github.com/Olical/conjure/commit/85a34f76a8845525839ab3ebc3481be037a4f259).
The next work on testing will be running tests in your current namespace as well as a -test
variant of the same name if I can find one. I'm also thinking of loading those namespaces for you but I'm not sure, that assumption that I'm allowed to load your namespace might be dangerous.
Maybe I should keep eval and test separate for you to decide? Feedback is appreciated on #20!
Published by Olical over 5 years ago
load-file
now uses the absolute path so if nvim is in another CWD to your REPL it'll still find the file you asked for: https://github.com/Olical/conjure/commit/c836140b3aaeb2db43a4f965678ce299dbdb81e9
:messages
now: https://github.com/Olical/conjure/commit/063c29b54459a326b5ff244685dd2765bcd19adf - hopefully you never see these, they're a last resort "oh no" place to put errors. If you see them, report them!/tmp
symlink: https://github.com/Olical/conjure/commit/3918cbc58113f7475c4679efa818df7d0513c8a5
So that's a few more closed issues and some more thought about async autocompletion. I think that'll land in v0.10.0
in the form of msgpack RPC over a port. So you can talk to the Conjure JVM process from other plugins directly without having to go through the nvim process which can block the UI thread.
Autocomplete plugins will just ask Conjure for it's RPC port then start communicating directly with it through there.
Have a great rest of your week!
Published by Olical over 5 years ago
The CLJS completion while you were autocompleting would constantly complain that it wasn't implemented yet. Now it'll quietly return nil. Conjure will try to use all of your matching connections as completions sources, this will be slow if you have a lot of connections for one file, once I get that parallel it means ClojureScript and Clojure completions in one list!
So editing CLJC files should be quite... fun? It'll show completions from both environments (once compliment supports CLJS).
Published by Olical over 5 years ago
The makefile was (once again) compiling on every make compile
not just when the code had changed. This has been resolved... again.
Also silenced completion so it doesn't complain about lack of connections. Added a function to just fetch the completions without any of the omnicomplete shenanigans for coc-conjure to hook into.
Published by Olical over 5 years ago
Added go to definition support under the gd
keys, closes #9. Will work much more consistently once #18 is done.
Right now if you ,rf
, ,re
, or ,rE
you'll lose the location meta data for the symbols you evaluated since they're fired across a REPL. ,rF
will load the whole file and they'll be put back. If I can get the location data being assigned to the symbols you're sending through the REPL it should fix this problem.
It works great, just expect it to not work as well when you're redefining individual symbols and not loading the whole file. If it can't find a match it uses Neovim's built in "first occurrence of this word" functionality. It just falls through to vanilla gd
.
This works in Clojure and ClojureScript, let me know if you spot any bugs!
Published by Olical over 5 years ago
When running make compile
without any existing classes dir it would fail because it can't rm
a dir that doesn't exist. This fixes it. Thanks @jorinvo in #17 for pointing this out.
Published by Olical over 5 years ago
I've added omnicompletion support through Compliment, you can see my thoughts on it in #8. There's definitely more I could do but this is a great start and frees up my time to go add the next feature.
Once the core features are down and there's a solid test suite I'll look into make each feature more powerful and integrated. Such as autocompletion popups and context for completion.
I hope omnicompletion works well for you! Let me know of any issues 😄
Published by Olical over 5 years ago
This is mainly just internal refactoring and renaming but I thought I'd release it anyway.
;
comment it would error.That's because it was commenting out the closing paren of some of my wrapper code that I wrap every eval inside for various reasons. You'd essentially end up with this...
(+ 10 10)
;; ohno
Becoming this (massively simplified)...
(do (+ 10 10)
;; ohno)
That last paren was being removed, thus, EOF.
Published by Olical over 5 years ago
\\\\
in use.The eval current / outer form issues were caused by some of the Neovim API being 0 indexed and some being 1 indexed. So some values have to be decremented or incremented in different cases while hunting for matching (){}[]
pairs of forms. That function was hard to get right but it works well in every case I can think of now!
Next up is a bunch of repo changes around documentation and then probably an initial autocomplete. Maybe some configuration as mentioned in #5, feel free to add your feedback there too!
Published by Olical over 5 years ago
let g:conjure_default_mappings = 0
.ConjureEvalCurrentForm
and ConjureEvalRootForm
now take []
and {}
pairs into account.Published by Olical over 5 years ago
This is the beginning of the new change log! Conjure used to be Rust, then I tried ClojureScript and finally settled on Clojure after throwing the two previous attempts away. The old attempts still live in branches.
The README contains everything you need to know so far. Here's to a long life of Conjure, v0.4.0 is a complete fresh start 😄