clojure-emacs / clj-suitable

ClojureScript "IntelliSense" support for JS objects and their properties/methods. Via figwheel and Emacs CIDER.
MIT License
113 stars 7 forks source link

Completion support for javascript libraries in node_packages #16

Open markokocic opened 3 years ago

markokocic commented 3 years ago

It would be nice if clj-suitable supported to have completion for Javascript libraries that are already installed in projects node_modules project.

shadow-cljs already supports requiring those libraries and using them as part of the application, but it's not possible to autocomplete them in cider or cursive.

Referenced shadow-cljs issue: https://github.com/thheller/shadow-cljs/issues/834

vemv commented 11 months ago

As a quick note, I wonder if we could reuse javascript-oriented LSP analysis. Running a full-blown lsp server seems error-prone, however perhaps the underlying library can be invoked in a one-off manner, similarly to when one asks clj-kondo for analysis (it runs for a bit, emits files and then it's all done).


...Maybe it's not necessary. Given a ["react-tippy" :as react-tippy] require, surely the cljs analyzer can tell us that react-tippy is a "foreign" object .