volrath / spiral

Emacs Clojure IDE based on UNREPL
GNU General Public License v3.0
148 stars 6 forks source link

Eval buffer code #1

Closed volrath closed 6 years ago

volrath commented 6 years ago

@cgrand @pesterhazy

Could you please help me review these changes? particularly 72a7b91..97630bf

Ignoring the facts that maybe buffer/file loading may want to be integrated into unrepl, or that maybe I'm missing some border cases, or that this example may be to small. What I want to know the most is if this is the correct way to generalize external tooling. Here's what I did:

  1. I created a subproject tools/ (I might transform it into a repo/jar file later) with a load_file.clj and a very simple load-file-code function.
  2. I created a custom session action for it.
  3. I call that session action when I need to load code.

There's something that I feel a bit repetitive in steps 1 and 2, I think it's having to "define" the function twice, but I don't have a big problem with it either.

So my main question is, is this the intended way to extend clients with their own tools?

Also, should we consider making a unrepl-tools repo with common tools for all clients?

cgrand commented 6 years ago

1 and 2 are repetitive because there’s only one backend right now. In a couple of months with cljsjs support it will make sense: one def two implementations.

volrath commented 6 years ago

@cgrand alright so I'll take it as in I'm in the right path.

I'm also not entirely sure this load-file-code implementation is robust enough (nrepl's takes special care of big files,) but it can be fixed in a different PR.

pesterhazy commented 6 years ago

Makes sense to me. Maybe we find a smoother way in the future