You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Completion support for javascript libraries in node_packages #16
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.
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 .
suitable does runtime introspection - it asks the live JS runtime for an object's properties. Completing node_modules libraries before they're referenced is a static-analysis job (LSP/TypeScript-level), well outside suitable's scope. Closing as not planned; an LSP is the better fit for this.
Activity
vemv commentedon Jul 22, 2023
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 thatreact-tippyis a "foreign" object .bbatsov commentedon Jul 18, 2026
suitable does runtime introspection - it asks the live JS runtime for an object's properties. Completing node_modules libraries before they're referenced is a static-analysis job (LSP/TypeScript-level), well outside suitable's scope. Closing as not planned; an LSP is the better fit for this.