vim 2023-11-24

anyone know how I can get omnicompletion/online doc for web APIs? [originally: I use vim-fireplace and vim-ale; anyone know how I can get omnicompletion/online doc for web APIs?]

I wish I knew. That would be handy.

like for completing methods on js/window, event classes, stuff like that. I hate having to task out to an MDN window

I'm using Conjure and had similar questions that I haven't yet found the answer to. Completion works, but docstring lookups don't. I found that adding [cljs.js :as js] to my require allowed for jumping to the function definition. Maybe something similar would help you with completion?

will try!

bump!

I have made some progress with this.

I was able to get omnicomplete for things like (js/document.querySelec by adding org.rksm/suitable {:mvn/version "0.6.2"} to my shadow-cljs deps and

{:cider false
 :middleware [cider.nrepl/wrap-classpath
              cider.nrepl/wrap-clojuredocs
              cider.nrepl/wrap-complete
              cider.nrepl/wrap-debug
              cider.nrepl/wrap-format
              cider.nrepl/wrap-info
              cider.nrepl/wrap-macroexpand
              cider.nrepl/wrap-ns
              cider.nrepl/wrap-out
              cider.nrepl/wrap-refresh
              cider.nrepl/wrap-stacktrace
              cider.nrepl/wrap-spec
              cider.nrepl/wrap-test
              cider.nrepl/wrap-trace
              cider.nrepl/wrap-undef
              cider.nrepl/wrap-xref
              suitable.middleware/wrap-complete
              refactor-nrepl.middleware/wrap-refactor]}
to my .nrepl/nrepl.edn, which shadow-cljs respects automatically. I am not sure I need refactor-nrepl in there but if you leave it in you’ll need to add it as a dep, too: refactor-nrepl/refactor-nrepl {:mvn/version "3.10.0"}

Oh, that's fantastic.

I'm suddenly imaging a babashka based tool that looks at local clj, local vim, and project-specific config to make recommendations

imagining—you mean having a nightmare?

anyway reading code and docs for cider.nrepl/wrap-complete it makes it seem you don’t need to put this in the config but this is how I got it to work.

Like what, a Swagger-based API? I haven't heard of anything like that, but I can how useful that would be.

Basically I would like to complete things like js/document.|

hmm realizing in general how does anyone do completion of method names given clojure’s (.method obj) syntax