Fork me on GitHub
#cider
<
2019-01-04
>
bozhidar07:01:55

@vemv I’d start with tackling the open bugs on refactor-nrepl and clj-refactor

🙂 1
vemv07:01:22

Will see what I can do!

benedek08:01:39

some alternative ways are outlined here to support clj/cljs/cljc without tools.analyzer

benedek08:01:35

i would consider rewrite this feature in cider itself if it is based on different stuff than the one in cljr

benedek08:01:03

an other alternative to write a minimalist analyzer/parser specialised for cider needs

benedek08:01:57

started such a thing but did not get far (see bug’s comment above about time… :/) https://github.com/benedekfazekas/utini

benedek08:01:48

either way (tools.analyzer, jvm.tools.analyzer or homegrown analyzer) it is a big endeavour but surely a very interesting one

benedek08:01:07

hope this helps a bit with context and not too confusing…

vemv09:01:18

Thanks much for the reply! I see. Just make sure, using the cljs compiler itself is not an option, right? Why not? I guess it either doesn't ever produce the necessary info, or it doesn't provide it in a good way right?

benedek09:01:53

i may be wrong here but using jvm.tools.anayzer is basically that

benedek09:01:20

the problem is that the AST produced this way is different than the AST produced by tools.analyzer

vemv09:01:42

> i may be wrong here but using jvm.tools.anayzer is basically that Got it! Seems likely > the problem is that the AST produced this way is different than the AST produced by tools.analyzer The problem being, clj-refactor assumes the latter format, perhaps?

benedek11:01:10

not 100% sure it was merged but maybe it was. and then the above is not true anymore.. maybe...

benedek12:01:54

seems to be merged last summer

vemv12:01:57

Very nice! With that in mind jvm.t.analyzer should be a promising approach right? I see no commits since 2017 (1 year before your link), so perhaps some adaptation work is needed

benedek14:01:29

maybe but as expez tells me in the refactor-nrepl github issue jvm.t.analyzer is just a thin wrapper so perhaps it does not need much work even if the stuff it depends on changes

vemv20:01:58

Nice. I'll try to play around with j.t.a + the cljs compiler + refactor-nrepl if that sounds like a good plan

benedek07:01:45

sounds awesome

benedek09:01:46

just to add one more idea (sorry) cider has many features that only work if the code is loaded in the REPL cider is connected to. probably find usages for loaded code only would much simpler to achieve and would still be quite valuable…

Robert Randolph13:01:50

just checking in to say that my issue with the *cider-error* buffer was indeed fixed with display-buffer-alist

enn14:01:51

Good morning. Can anyone tell me how cider-connect auto-detects the port number chosen by lein repl? I'm working with an in-house script that tries to do what lein repl does, and it starts the REPL correctly, but cider-connect port detection does not work.

aisamu15:01:40

IIRC, there's a .nrepl-port file (or something like it) at the project's root

bozhidar15:01:26

It’s more than this - cider also parses the output of ps and extracts some port information for there.

enn16:01:54

Thank you!

dominicm18:01:37

Had an interesting idea today. Inspired by a tool I saw a while ago. If functions were annotated with metadata, they could be identified as dev helpers automatically. Emacs could render a buffer with buttons to call reset, generate-data, etc. Further extensions could define simple inputs (or use spec?) to allow for prompting for input, and perhaps also delegating to an nrebl-alike for rendering results in tables.

👍 1
rickmoynihan02:01:54

What was the inspiring tool? Assuming you also mean vars. And is this effectively like in repl/editor binstubs?

rickmoynihan02:01:36

Something that bothers me about tools.deps is the lack of consistency it brings, with regards to build tooling.

dominicm06:01:14

I couldn't find the tool with a quick Google

dominicm06:01:28

You're up late

futuro21:01:58

That's a pretty neat idea!

ag22:01:33

what’s the way with the latest cider to force it run something in repl once jack-in… you know via settings in .dir-locals.el

dpsutton22:01:27

cider-connected-hook?

ag22:01:22

so if I want to run something like (start) what should be the content of .dir-locals.el?

ag22:01:36

cider-connected-hook is a variable defined in 'cider.el'.
Its value is (cljr--init-middleware)

ag22:01:57

I guess I should keep that and add whatever I need?

dpsutton22:01:59

go look at that function and you can see a template

ag22:01:30

which fn?

dpsutton22:01:41

(cljr--init-middleware)

ag22:01:00

hmm… still not clear what content of .dir-locals.el should be?

((nil
  (cider-connected-hook . "???")))

ag22:01:22

basically I’m looking for a new way of setting up what’s used to be cider-cljs-lein-repl var

ag22:01:10

so I figured I can probably set cider-custom-cljs-repl-init-form but how do I set default type (to be “custom”), so it doesn’t bother me with a prompt?

ag23:01:17

Nah, I think setting up that var had no effect

ag23:01:13

I have figured it out. .dir-locals.el

((nil . ((eval . (with-eval-after-load 'cider
                   (cider-register-cljs-repl-type
                    'fw-cc
                    "(do (start) (start-fw) (use 'figwheel-sidecar.repl-api) (cljs-repl))")
                   (setq cider-default-cljs-repl 'fw-cc))))))