This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-29
Channels
- # aleph (1)
- # announcements (5)
- # beginners (21)
- # cider (4)
- # clojars (1)
- # clojure (39)
- # clojure-europe (5)
- # clojure-norway (133)
- # clojurescript (5)
- # datomic (27)
- # exercism (2)
- # gratitude (4)
- # humbleui (21)
- # hyperfiddle (10)
- # integrant (16)
- # introduce-yourself (1)
- # lsp (17)
- # matrix (1)
- # nbb (10)
- # overtone (5)
- # polylith (21)
- # re-frame (6)
- # squint (3)
- # tools-deps (22)
- # yamlscript (102)
hello : ) i don't now how hard or easy it is, but having node.js modules auto-complete is so important for me. With Clojure there is cursive if we add type annotations, but with Clojurescript we dont have a way.Do you know if there are plans to add this sometime?
That would be something nice indeed for cljs projects, but it's not trivial, the first step to achei e that would be have analysis of the node modules in clojure-lsp, for all clj things we have clj-kondo that return these analysis, we would need to check if we could improve kondo for that or use another tool
@U04V15CAJ is there any issue or plans to add support for node modules analysis in clj-kondo?
This can be accomplished by using a Node.js REPL like nbb, or shadow-cljs Node.js repl ;)
You mean use the reply to workaround this or you mean use that in clj-kondo or something like that?
Yeah, I was thinking if we could do something like we did for clj-easy/stub, that starts a process collect all that and we use it
That'd be a start of improving static analysis with repl data which is something interesting
JS is far more dynamic and therefore more complicated to get auto-complete right I think, even harder because of clj-kondo/lsp being implemened in JVM instead of Node.js. From Node.js you can probe and evaluate things. The REPL can tackle such dynamic queries. Stuff like what is on the global object (js/...)
can't be answered by scannning node_modules, but depends on your runtime
Also there is the whole CJS/ESM horror story: just looking at the source won't tell you exactly what is exported where, it also depends on package.json etc
So if you really want to try something, maybe write an experimental dump tool like you suggested, maybe a Node.js program that is ran over node_modules and js/.. once. Or maybe stuff that uses jsdoc or so, I don't know