Fork me on GitHub
#cider
<
2019-08-04
>
pez14:08:05

I don't know where to ask this, sorry for OT. Does anyone know what is the status of clj-refactor? We are trying to implement some refactorings/utilities based on it and for something like find-symbol it only supports .clj files. And if I use it on such a file that requires a .cljc file, it throws me back an exception.

benedek18:08:50

current implementation of find-symbol is a dead end in terms of cljc/cljs support

benedek18:08:32

the way forward is rewrite-clj based static analysis i think. i started a POC and a tool building a generic AST with this approach called #trin . does not have support for find global symbols atm

❤️ 1
benedek18:08:50

that said clj-kondo uses the same approach (and some other recent tooling projects as well) and it has support. afaik in the next release clj-kondo will be able to emmit this analysis info to some extent

benedek18:08:57

so if you wanna do something NOW i recommend looking at clj-kondo

benedek18:08:28

or you can ofc start contributing to trin ;)

benedek18:08:48

tbh i went back to working (in terms of for money ;) )

benedek18:08:10

so trin is parked until September or so

dominicm18:08:31

Don't leave me in September 😿

benedek22:08:27

haha gonna be off in sept and then back in oct

pez18:08:35

@benedek, thanks. I have been looking a bit at clj-kondo lately and dreamed about how it could help. But for Calva I need something that I can either reach through ClojureScript, as a library, or through nrepl, injected into the application. I can't bundle clj-kondo.

pez18:08:32

I'll have a look at trin.

benedek18:08:53

it is early days for trin keep in mind

pez18:08:18

I'll keep that in mind. ❤️

benedek18:08:19

trin is deffo a candidate for orchard eventually

pez18:08:57

Which is extra cool. I really like the idea of pooling our efforts through the orchard.

bozhidar18:08:26

@pez Yeah, let’s discuss how to approach this.

dominicm18:08:14

Please use this funding window in a pooled way. Moving towards a common goal would be awesome!

bozhidar18:08:24

You might have seen I’ve implemented a variant of find-usages in Orchard that’s not using static code analysis, but currently it’s clj-only and doesn’t give you the precise locations where something is used (only the containing definition). I think that making that work for cljs won’t be hard, but the limitations are likely going to remain, so we have to get creative and figure out some better approach.

bozhidar18:08:33

@dominicm No argument from me. 🙂

bozhidar18:08:57

I didn’t plan to work on this, but I’d be happy to.

benedek18:08:38

what do you mean by funding window @dominicm?

benedek18:08:12

cljists together?

dominicm18:08:17

Both @bozhidar and @pez are being funded by clojurists together this quarter.

benedek18:08:30

aha, right

dominicm18:08:13

Double the cider, double the trouble

benedek18:08:01

i missed the announcement i guess..

dpsutton18:08:07

oh i missed hat announcement too

pez18:08:31

I've been out on the look for the announcement, but missed it. 😃

benedek19:08:44

i might give clj-kondo a go and try to use it MrAnderson

borkdude19:08:26

you can use clj-kondo on the JVM, but not CLJS unfortunately.

borkdude19:08:51

it analyzes CLJS but you cannot run it from within Node for example, is what I mean

pez19:08:12

Is it possible to make it work from CLJS?

borkdude19:08:38

with some effort, maybe yes

borkdude19:08:27

but right now I'm using rewrite-clj which is JVM only

borkdude19:08:35

and tools.reader which lives on the JVM as well

dominicm19:08:51

There's a rewrite-cljs that needs a little love

pez19:08:01

It is being merged with rewrite-cljs (ported to cljc).

borkdude19:08:09

yes, dear @lee is working on a .cljc variant

borkdude19:08:24

but even then, I'm using a forked version with some tweaks very specific to clj-kondo

borkdude19:08:49

e.g. stripping out things at parse time (whitespace and comments) and patches for namespaced maps, metadata, etc.

pez19:08:50

The patch for namespaced maps should be applied to rewrite-clj, right? (If it is what I think it is)

borkdude19:08:35

yes, it will be in the -cljc version I think

lread19:08:56

yup! I will release rewrite-cljc sometime - I was writing up some docs for it when I noticed some cljdoc issues and am enjoying looking into those right now.

❤️ 2
metal 3
parrot 1