This might be interesting for Cursive users A quick hack for Cursive to provide autocompletion for js libraries in clojurescript https://romanliutikov.com/blog/enabling-javascript-autocompletion-in-cursive-for-clojurescript
This looks awesome! Is the format of the stubs file documented somewhere? I might investigate doing something similar for ClojureDart. Or I'll just look at the output of your utility if no readily available documentation.
@andre.richards it just has to be a js file with flat structure, it's explained in the blog post
too bad Cursive won't pick up type info from jsdoc, so that method calls on return types are picked up as well (.attr (d3/create) "width") ; <- attr is not resolved here
so it's only relevant for top level functions/values in a library
I don't know when and if ever Cursive will land better integration story with underlying platforms (js/npm/dart etc) but it would make life easier if there would be open extension points. IIRC IntelliJ plugins system supports that
maybe that's something that can be done in a separate plugin. Intellij can already index js/ts/dart etc
Cool, yeah ClojureDart 'suffer' from the same problem. I love using it instead of Dart, but it would be nice if there was better integration with Dart libraries. Even if it is just for the Flutter lib, which is what one uses 90% of the time. Anyway, thanks for this, it is very interesting.
I'm actually working on this right now, for JS at least. I'm planning to use TS types (.d.ts info) for the JS completion. It's a big project, but it is on the way. Once that is done I'm also planning to add similar support for cljd, since the process will be similar.
But the stubs idea is a great hack for the meantime for sure, thanks @roman01la!