Fork me on GitHub
#conjure
<
2020-04-24
>
Olical10:04:24

Current todo list before release (barring any bug reports from you fine folk): * Make sure completion is all good and support is ready in every async plugin. * Find and fix the issue @nate mentioned where he got his log / HUD into a weird state (still can't reproduce). * Finish documenting by writing up doc files on the Fennel and Clojure clients as they currently stand. * Battle test for a few days (everyone's help is very appreciated here ❤️ ) * Release!

Olical10:04:52

I have a bunch of other quality of life things (folding multi line results, event hooks for reacting to certain output) but they'll come after. I just want to make this a good baseline and have it replace the existing release ASAP.

Olical10:04:23

Also the ConjureSchool will make a comeback, but again, after the core is solid and released.

dharrigan10:04:42

I'm happy to do some battle testing when ready

Olical11:04:37

It's totally useable already, I hope 😬 going to write up some more docs now for the clojure specific stuff

Olical11:04:02

If anyone has any gripes with :help conjure please let me know now so I can tidy it up!

pyrmont11:04:36

@olical Maybe this should wait for the docs to be finished but if someone wanted to use it with Fennel, is there a simple explanation on how to do that?

Olical11:04:16

All you need is https://github.com/bakpakin/fennel.vim installed for syntax etc then you can just open any .fnl file and eval like you would Clojure.

pyrmont11:04:25

I presume, for example, that nREPL isn't a part of the pipeline?

Olical11:04:28

It'll eval within Neovim's Lua runtime itself.

Olical11:04:34

Nope, no nREPL involved, it's much simpler.

pyrmont11:04:36

Ah, of course.

pyrmont11:04:53

I forgot Neovim has the runtime, er, running.

Olical11:04:10

Then you can install https://github.com/Olical/aniseed if you wanted to write some of your dotfiles in it and have them automatically compiled and loaded where required.

Olical11:04:30

Or use it to statically compile fennel -> lua with the module macros I've provided.

Olical11:04:48

I still need to write up Aniseed's docs though, that's coming after Conjure has a stable release.

pyrmont11:04:02

Cool. I'll look into that. I'm curious about using Fennel (or maybe Janet) for certain uses where I currently reach for Ruby and like the idea of being able to do that with a language with a sort of integrated REPL.

👍 4
Olical11:04:15

Ah neat, well bear in mind that the current Fennel support is entirely based on Aniseed and running within Neovim itself. If we want to have Fennel running on it's own LuaJIT process or something (like you would have Clojure running in it's own JVM process) that'll require another client.

Olical11:04:33

But I built Conjure with that in mind.

Olical11:04:46

So it can be done! Janet will be a cool one for sure, I can't wait to experiment with it.

👍 4
Olical11:04:43

Like how the Clojure client is nREPL specific, I may add one for prepl that you can swap to if you want one day. So this would be another Fennel client that wasn't based on Aniseed and allowed you to run things outside of Neovim's process.

dave12:04:51

i used it yesterday to do some actual work and it was a nice experience. it felt better than conjure.current. come on in, the water's fine 🙂

🎉 4
dave12:04:48

one thing i just ran into: if i start neovim and then start my nrepl server, is there a way to tell conjure to check again for the .nrepl-port file and connect?

Olical12:04:24

With the prefix

Olical12:04:28

For connect to file

Olical12:04:46

It'll also check for shadow cljs's portfile, but tries the norm nREPL location first

dave12:04:23

excellent, that did the trick 👍 heads up that that mapping isn't in the help text 🙂

Olical12:04:52

Yep, it will be in the clojure specific docs, which I may get around to today!

Olical12:04:04

That isn't a global mapping, it's specific to Clojure nREPL

dave12:04:07

oh, ok -- makes sense!

Olical12:04:19

Thanks for pointing it out though!

nate15:04:05

aha! remember when I said that printing a lot sometimes gets the output incorrect? I figured out what is happening.

nate15:04:17

I've got some code that generates a big string

nate15:04:20

it's a report of sorts

nate15:04:36

and then I (println report)

nate15:04:06

I would get results like this:

; (out) A quick brown fox jum
; (out) ps over the lazy dog
should be
; (out) A quick brown fox jumps over the lazy dog

nate15:04:13

and the cut point seemed to be random

nate15:04:40

then I thought it might be a boundary issue, so I copied the outputted text to another file a few times

nate15:04:13

$ wc -c out?.txt
1023 out1.txt
1023 out2.txt
1023 out3.txt

nate15:04:27

looks like it's cutting long strings at 1024 and inserting a newline

nate15:04:51

an easy reproduction is:

(println (apply str (repeat 2000 "x")))

Olical15:04:56

Ah of course! nREPL splits things up

Olical15:04:12

Which actually worries me because I think very large results (data) will also get cut

Olical15:04:21

So I need to write things that can handle chunked results

Olical15:04:41

I have parsing of partial bencode values working but I guess I also have to handle multiple nREPL messages for one result 😬

Olical15:04:23

I don't know if there's a way for me to distinguish between two separate out messages with a line between them and one line that was split by nREPL :thinking_face: I don't think they get trailing newlines but I could be wrong

nate15:04:16

I just tried a big data structure (3397 characters) and that didn't have any superfluous line breaks

Olical15:04:33

Okay, I'm sure I can handle that

Olical15:04:45

The HUD getting stuck open still worries me a little though

nate15:04:54

I also noticed that when you println, leading whitespace gets trimmed

nate15:04:07

don't know if that's conjure or nrepl

Olical15:04:11

Ah yes, I did do some trimming, I'll try to avoid that

Olical15:04:14

I think that's me

Olical15:04:24

I'll play with long stdout soon

nate15:04:34

my "report" has some whitespace indenting

nate15:04:50

so when I tried to split it and println each line, there was no indenting

nate15:04:58

which is how I noticed it

Olical15:04:19

Yeah, that's rough, I'll preserve it in the future and find a way to join out messages properly. Thanks for the report!

nate15:04:22

I haven't seen the HUD issue happen a second time

Olical15:04:01

I haven't reproduced it since I was initially writing it. I saw that issue when I accidentally lost the state of the hud and it's window id

nate15:04:34

maybe if there's a :ConjureDebugReport command or something that will inspect things about the running plugin and dump it to a text file

nate15:04:45

kinda like an apple crash report

Olical15:04:15

Hmm, not sure what I'd put in there :thinking_face: but yeah, worth some thought!

nate15:04:14

yup, just an idea

nate15:04:39

thanks again for Conjure, it's wonderful

Olical15:04:14

I'll take a look at the out stuff now, I think it'll be tricky to solve properly but I'll give it a go!

Olical15:04:34

You're more than welcome! I'm glad you're enjoying this version so far, I was worried everyone would hate the changes I've made 😅

nate16:04:49

heh, I understand, but you've done a good job of keeping development transparent, so we're all on board

dominicm15:04:00

@olical there's an open nrepl issue about multi results

Olical15:04:23

Oh interesting, like results being cut up?

dominicm15:04:57

No, about putting them back together :)

dominicm15:04:16

Tpope found it, I think bug reported it

Olical15:04:42

Finished the core documentation (first pass anyway), so I've even got notes on client implementation now. I'll add the Clojure and Fennel client specific docs soon! Just going to look at joining Clojure out strs together now though.

Olical16:04:50

The completion works with babashka nREPL https://asciinema.org/a/H7136YMD9J9bU7l6GZE1yVNAa !!!

🎉 16
Olical16:04:24

Documentation and test output seem to go to the terminal but there's probably not much I can do with that. And where stdout goes wrt babashka is probably very debatable given it's context and commandline tooling.

Olical16:04:52

Think I'll have to make my display-results function return a stateful thunk to get this stdout displaying correctly :thinking_face:

Olical16:04:05

I'll have a thunk about that thunk, but once that's sorted I might just need to document implementing completion clients, fennel and Clojure. Then release!

nate16:04:33

totally random thing I just ran into

nate16:04:57

I did a git commit ... on a system with no neovim

nate16:04:14

Error detected while processing /home/nate/.dotfiles/.vim/bundle/conjure/plugin/conjure.vim:
line    1:
   9: Sorry, the command is not available in this version: lua require("conjure.main").main()

nate16:04:31

need a guard or something in there

Olical16:04:47

Oh! I need to completely disable conjure in normal vim. I didn't really think people would overlap their vim and Neovim config so I didn't worry about it.

Olical16:04:50

Will guard!

nate16:04:09

cool, thank you

nate16:04:33

I used to float back and forth a lot, but am increasingly just installing neovim

nate16:04:48

I don't know how common my use case is

nate16:04:09

pulled, tried, verified!

Olical16:04:07

Yay 🎉 I suppose I could add more about not having the HUD if you don't have floating windows and things :thinking_face:

Olical16:04:38

I don't think there's a way to check for floating windows like that though, maybe I could sniff for a function but that could be awkward. I'll leave it as is for now.

rafaeldelboni20:04:43

Is there a way to customize the theme of the HUD?

Olical20:04:51

Oh wow, that looks baaaaad, mine looks like this:

Olical20:04:11

I think that's just a highlight group, so it depends on your colour scheme :thinking_face:

rafaeldelboni20:04:34

yeah is my personal theme, I will try to tweek some settings

Olical20:04:58

I'm googling but I'm not sure what the highlight group for the background of a floating window is called.

Olical20:04:10

If we can find that then you can set the background to any colour that suits you

Olical20:04:33

I may add optional borders at some point too, although I'm not sure yet since it involves all sorts of ASCII and window hackery. The less I add, the less bugs you can get.

rafaeldelboni21:04:28

woah I figured out, because the ; the theme is interpreting the text as comment

rafaeldelboni21:04:39

which have this pale color

Olical21:04:35

Oh yeah, it will do that, but I'm wondering if you can set the colour of your floating window background to something darker

Olical21:04:49

Or you could make you comments darker I guess?

Olical21:04:32

I'm not sure on the highlight group for floating windows though :thinking_face:

Olical21:04:42

Mine are just a little bit lighter than normal, but I can still read everything okay

rafaeldelboni21:04:50

Pmenu and PmenuSel I think

Olical21:04:22

Oh really!

Olical21:04:24

Interesting!

rafaeldelboni21:04:15

Is possible to set to the log buffer to the botton panel when I open in the horizontal split or in the right panel on vertical split? Is configurable?

Olical15:04:49

Hmm, what do you mean by panel? Do you mean if you have an existing split?

Olical15:04:06

Because I think that'd be quite difficult :thinking_face:

rafaeldelboni15:04:04

yeah I mean, I can move it around with Ctrl + W HJKL

rafaeldelboni15:04:45

but I'm quite used with the behavior of the old conjure of opening the buffer on the bottom

Olical15:04:48

Oh, where is it appearing for you right now? Like in the top or left?

rafaeldelboni15:04:14

for vertical on top and for horizontal left

Olical15:04:53

Ah okay, that's not right, mine appears in the bottom and right. So it's a vim config thing. I can set it, I hope everyone is okay with it always opening in the bottom and right.

Olical15:04:59

I think it's what people expect.

Olical15:04:22

So you can use set splitbelow etc to make all splits open either to the right, left, top or bottom.

Olical15:04:56

But I could force Conjure to always split that way, just not sure if I should :thinking_face: like should I rely on your global split config or override it? Some people might not want it to be overridden.

rafaeldelboni15:04:51

woah thanks for that settings

rafaeldelboni15:04:11

I will definitely add to my init.vim

Olical15:04:15

I've always had that set, will see what people think about forcing the location.

rafaeldelboni15:04:43

but yeah, if is not hard to make a config for this settings at conjure side would be greate

rafaeldelboni15:04:56

but I really fine with the set splitbelow

Olical15:04:39

I could definitely do it, it just adds more complexity and things I need to explain. If I rely on the global setting it's easy for me and built into Neovim. I'll see what some others think 😄 I think splitbelow and splitright are really good to have set anyway.

Olical20:04:52

Might be fun for those of you playing with autocompletion now: https://twitter.com/OliverCaldwell/status/1253780097708036106

🎉 4
Olical20:04:11

set pumblend in Neovim to have slightly transparent completion menu in the terminal!