Skip to content

[Legacy Rust] Completing and fixing things

Compare
Choose a tag to compare
@Olical Olical released this 11 Jan 16:48
· 2282 commits to master since this release
b28bdf7

Completion!

There's omnicompletion now, it works really well for Clojure and will show all symbols / aliases / namespaces available to you. I haven't bothered with keywords yet but I suppose that could be added somehow?

ClojureScript isn't as good, it only completes your local namespace symbols and cljs.core because I don't have the functions I need to look things up in that environment. Maybe I'll find workarounds some day though! I just need a way to list aliases and all namespaces 🤔

I'm using these deoplete settings and they're working fairly well. Although sometimes the cursor flashes if it has no matches which is a bit weird, suggestions appreciated.

let g:deoplete#enable_at_startup = 1
autocmd InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
set completeopt-=preview

call deoplete#custom#option('omni_patterns', {
\ 'clojure': '\w\|-\|\.\|+\|*\|/',
\})

Completion is asynchronous and the cache is updated on cursor idle per-buffer. It should be extremely snappy. Let me know if it's really slow for you though! It may well be on large projects, I might need to rethink it if this lazy approach uses waaaay too much memory and CPU.

Go to fixes

Go to definition was a bit borked with some files, that should be fine now. It was inserting file: before some files when I looked them up in io/resources but I'm stripping that off now.

Subtle improvements

Stuff like using user as the default for Clojure and cljs.user for ClojureScript. Things that you'd only notice in some rare cases really but I improved them anyway. Much more to come in the "under the hood tidy ups" department.