Fork me on GitHub
#vim
<
2019-07-23
>
Chase00:07:22

interesting. Goes to show I'm probably not utilizing the power of the repl enough because I've just been relieved to come back to clojure and get my interactive eval'ing on.

Chase00:07:02

I'm thinking I'm not getting autocompletion suggestions because I don't think coc.nvim actually uses omnicomplete because it blocks something, I don't know. I'll have to rethink how I want to go about that. I would like to keep using coc.nvim as it's been a great experience for me in other languages.

Chase00:07:12

Conjure seems to provide a coc-conjure extension that makes it work together so maybe I'll give this whole socket repl thingamajig a try. I always fall into this tinkering trap though and go back to my nice fireplace work flow.

tpope00:07:32

fireplace just provides vanilla omnicomplete, i'm not sure which if these plugins can leverage that. @dominicm can maybe say more

Chase00:07:15

but how does Compliment fit in to all of this? "If you use Nightcode, vim-fireplace, or Atom, then you don’t have to install anything at all — Compliment will already be there for you." from it's readme

tpope01:07:59

cider-nrepl depends on compliment

tpope01:07:17

so you don't have to install it if you've "properly" set up fireplace

Chase01:07:16

Yeah it was my whole confusion on omnicompletion. Coc.nvim doesn't use it for it's autosuggestions apparently. Once I hit <C-x><C-o> which if I remember correctly is the omnicompletion button I get the suggestions I was looking forward. Now the debate is if I want autosuggestions I need to abandon my coc.nvim setup or abandon fireplace for conjure which apparently integrates the Compliment autocompletion with coc.nvim nicely (maybe a third option I'm not seeing). The ole lose-win, win-lose situation unfortunately.

Chase01:07:22

thanks for the clarifications!

dominicm07:07:34

I haven't played with coc.nvim at all, but could do. It didn't turn up in my searches, probably because I assumed it was a language-server only tool. async_clj_omni provides integrations with ncm2 & asyncomplete (and also a legacy ncm1, the deoplete integration is broken & I need to chase it)

dominicm07:07:57

blugh, I wish we could get to the bottom of this lsp stuff and not have every plugin that provides a modicum of integration with lsp having a billion features.

dominicm07:07:32

coc & ale have so much overlap it's crazy. They're completion & linting tools, why to they both have documentation bindings?!

dave13:07:43

i was trying to puzzle my way through this recently. the overlap is definitely confusing. i finally landed on having both installed, and they do seem to play nice together, FWIW

dave13:07:43

i do have this in my config, lifted from @U0ECYL0ET :

nnoremap <silent> K :call <SID>show_documentation()<CR>

function! s:show_documentation()
  if &filetype == 'vim'
    execute 'h '.expand('<cword>')
  else
    call CocAction('doHover')
  endif
endfunction
so i guess that overrides any binding of K that ALE might be doing

dominicm14:07:22

I don't like the idea of rebinding K, that's what 'keywordprg' is for

dominicm14:07:40

(I know fireplace does it, but only for .clj, and I think that's reluctantly)

dave20:07:51

whoops, i totally lifted the above from @U0BUV7XSA, not @U0ECYL0ET. the people developing badass clojure vim tooling are all starting to blend together in my mind

dominicm07:07:16

https://github.com/neoclide/coc.nvim/wiki/Create-custom-source this looks fairly amenable to the fireplace async api, shouldn't be too difficult to get this written. It'll be a little while before I muster up the energy to figure out how to install coc though 🙂 The bulk of it should be something like:

function! coc#source#async_clj_omni#complete(opt, cb)
  call fireplace#omnicomplete({candidates -> a:cb(candidates)}, a:opt.input)
endf
Where a:opt.input may need to have matchstr called against it in order to strip extraneous things like (.

dominicm07:07:20

Fireplace just shipped an async completion API, so async_clj_omni is now supporting asyncomplete & ncm2. coc.nvim coming soon™

dave13:07:34

coc is totally worth installing, IMO. it completely changed my vim experience

dave13:07:09

a lot of autocompletion stuff just works out of the box. there are a ton of coc plugins available that you install via :CocInstall and it just works™

dominicm14:07:01

I only write clojure 😄

dominicm14:07:06

and occasionally viml

dominicm14:07:19

I really hope these plugins will shrink once nvim lands native lsp support

👍 4
xi14:07:08

@dave Can you list a few of your favourites please? I'm using snoe/clojure-lsp very happily

dominicm14:07:01

@slack1274 which lsp plugin are you using clojure-lsp with?

xi14:07:55

Uh, CoC?

dave14:07:14

i also use clojure-lsp which is great, and i use coc-conjure too which is nice i also use: • coc-gocode (go) • coc-java • coc-rls (rust) • coc-solargraph (ruby) • coc-html • coc-json (supports JSON schema) • coc-vimlsp (viml) • coc-marketplace (provides an easy way to search for coc extensions without leaving vim)

👍 4
dave14:07:10

it's especially great for statically typed languages. you can see the docs/type signatures for methods when you hover over them or start to autocomplete them

dominicm14:07:05

@dave got a repl open? if you try and complete with j.l.S does anything come up from coc-conjure?

dave14:07:34

in any old project i have laying around?

dominicm14:07:59

You should get java.lang.String as an option.

dominicm14:07:40

I'm also getting some weird stuff where coc is caching the results and not triggering for every character change, so for rem I'm seeing reify

dominicm14:07:53

Interesting, I can't seem to get that. Will have to go read coc-conjure then 🙂

dominicm14:07:04

I'm guessing there's something undocumented

Olical14:07:03

It's talking directly to Conjure's stand alone JSON RPC server to get completions without blocking Neovim in any way, if that helps at all. I guess it's mainly about how the plugin is written.

Olical14:07:17

Like, the conjure specific part shouldn't matter?

dominicm14:07:32

it doesn't 🙂 I was just checking whether coc-conjure had figured out how to make this work or not

dave14:07:18

could be clojure-lsp doing that

dave14:07:22

i have both things installed

dave14:07:48

i guess if clojure-lsp were doing that, then i would still see it even if my repl isn't running

dave14:07:24

i do NOT see it if my repl isn't running, so it must be conjure

dominicm14:07:05

I don't think clojure-lsp uses compliment, and that's a compliment feature

dominicm14:07:51

ah, I get them, but only sometimes, because reasons I guess

dominicm14:07:47

okay, I just have to be actively typing

dominicm14:07:05

I have something that basically works, but coc.nvim doesn't support certain things that I need to do this in pure vimscript. I'm trying to avoid creating an npm module tbh.

dominicm14:07:44

I opened an issue, and we'll see where it goes 🙂

Chase15:07:52

Yeah I'm thinking Conjure has found a way to get Compliment autosuggestions working nicely with coc.nvim. Is that what you folks are saying? And you are thinking of trying to get that same functionality with fireplace? Either way, thank you guys so much for discussing it.

dominicm15:07:26

@chase-lambert I have something that 80% works with coc.nvim for fireplace, yeah 🙂

dominicm15:07:38

https://github.com/neoclide/coc.nvim/issues/1016 I need this so that you get a refresh after hitting / for namespaces

Chase15:07:47

I might try clojure-lsp again with coc.nvim but I want a way to just shut it off without shutting down the rest of coc.nvim's completion capabilities. Sometimes the language server is a bit too "pushy" for me as I'm experimenting around.

dominicm15:07:47

I could push up what I have for now, and you'd have an 80% solution I guess 🙂

Chase15:07:29

Nice! The maintainer of coc.nvim is ridiculously responsive and productive.

dominicm15:07:49

yeah, he's helped me a lot on unrelated things. I'm sure he'll respond very quickly.

Chase15:07:34

I'll install this async-clj-omni and give it a go. are you saying it longer requires deoplete as I don't plan on switching to that

dominicm15:07:54

async-clj-omni supports lots of sources. I should update the README to be clearer.

dominicm15:07:58

it's a completion for lots of things now.

Chase15:07:34

ahhh, yeah ok, I see now, it would help if I scrolled down a bit more.

Chase15:07:23

so once I get this working, what is the overlap between this, Compliment, and clojure-lsp?

dominicm15:07:46

compliment is a general-purpose clojure library. It's used by cider for completion, and also by conjure.

dominicm15:07:55

updated the readme, hopefully a bit clearer

Chase15:07:38

ever since I added cider-nrepl in I get these warnings when starting lein repl :

WARNING: An illegal reflective access operation has occurred                         
WARNING: Illegal reflective access by mranderson049.orchard.v0v4v0.dynapath.         
v0v2v5.dynapath.defaults$eval3696$fn__3697 to method java.net.URLClassLoader         
.addURL(java.net.URL)                                                                
WARNING: Please consider reporting this to the maintainers of mranderson049.         
orchard.v0v4v0.dynapath.v0v2v5.dynapath.defaults$eval3696$fn__3697                   
WARNING: Use --illegal-access=warn to enable warnings of further illegal ref         
lective access operations                                                            
WARNING: All illegal access operations will be denied in a future release

Chase15:07:57

Anything I need to do there or just ignore them? No clue what mranderson/orchard is

dominicm15:07:57

that's fine, don't worry about it

Chase15:07:17

Yeah, readme is clear as day. Thanks! I'm a slow one so if I get it you are good to go

dominicm15:07:31

they'll disappear in java 12 I believe. In java 11 they report themselves as accessible, but then you use them & this happens.

dave15:07:52

in java 12, won't they just stop working?

dominicm19:07:03

No, because they won't be flagged as accessible. And the thing searching the chain will continue until it finds something that's actually accessible.

Chase15:07:05

it's working! it's working!

Chase15:07:24

man, coc.nvim with these autosuggestions and the documentation in the floating windows is such a darn game changer for (neo)vim for me.

dave15:07:13

^that's what i'm saying! it's a whole new editing experience

Chase16:07:25

yeah I fell in love with it with rust but couldn't figure out a way to get that goodness with Clojure. I think we're there!

dominicm19:07:21

@chase-lambert update coc.vim, chez fixed the bug and now / will trigger a re-scan.

Chase20:07:55

Nice! Thanks so much man. Didn't expect to have all my wishes and desires fulfilled in one day. hahaha.

Chase20:07:48

I have a weird thing where PlugUpdate leaves my coc.nvim updates in pending status sometimes. I haven't found a rhyme or reason to it yet so not sure I'm updated fully yet. What's something I could input to see this / re-scan in action?

Chase20:07:32

if I just put / in randomly I do see autosuggestions for /bin/ /dev/ /etc/, etc.

dave20:07:14

i've had to retry the coc.nvim update (by pressing r after vim-plug tells me which plugins failed to update) the last couple times for some reason. it's strange