Fork me on GitHub
#cursive
<
2017-02-09
>
tianshu02:02:13

I'm trying to install cursive for clojure development. Cursive will download leiningen(although there's lein available on PATH) but failed. Now I want to manually put the leiningen leiningen-2.7.1-standalone.jar somewhere that Cursive can locate it. How can I achieve?

cfleming02:02:56

@doglooksgood Cursive will use the one in ~/.lein/self-installs like lein itself does.

tianshu02:02:43

my ~/.lein/self-installs is empty, maybe this is because my leiningen is installed via homebrew? I will have a try

cfleming02:02:18

Interesting, do you know where homebrew leaves it?

cfleming02:02:31

I wonder if there’s any way to have Cursive pick those up too.

tianshu02:02:35

Yes I know

tianshu02:02:07

Now I copy this jar to ~/.lein/self-installs and It works, thanks!

tianshu02:02:49

the jar installed by homebrew is located at /usr/local/Celler/leiningen/2.7.1/libexec/

tianshu02:02:29

BTW, It's there any trick to help me figure out where the file from and path the file will be placed when I know there's process is downloading something?

cfleming02:02:31

Hmm, I wonder if I can figure that out somehow without hard-coding it.

cfleming02:02:51

Which OS are you using?

cfleming02:02:24

There are various answers here: https://apple.stackexchange.com/questions/14409/how-to-monitor-file-access-for-an-os-x-application - looks like Instruments might be the tidiest option if you have XCode installed.

tianshu02:02:55

Thanks, I'll take a look!

tianshu02:02:36

@cfleming Just realized you are the author of Cursive, awesome!

cfleming02:02:42

I’m planning to work on the Parinfer impl soon too, don’t worry 🙂

tianshu02:02:53

why Cursive not ship a second completion system from REPL. maybe that can have better perform for macros?

cfleming02:02:27

It does when you’re working in the REPL, but that doesn’t work when you’re in your editor.

cfleming02:02:47

The problem is that IntelliJ needs to resolve symbols all the time, for things like inspections.

cfleming03:02:08

Emacs etc only need that info on a user action (doc lookup, navigation etc)

tianshu03:02:27

Just not comfortable to see that there's a lot of stuffs can not resolve. I've see https://cursive-ide.com/userguide/macros.html And I want to use it on following code:

(defstate |datasource  ;; | is my cursor
  :start
  (make-datasource db-spec)
  :stop
  (close-datasource datasource))
the datasource is unable to resolved here, but nothing popup after press Alt-Enter .

cfleming03:02:04

@doglooksgood You want your caret on the defstate

cfleming03:02:51

I just realised that’s ambiguous in the screenshots, I’ll clarify that doc.

tianshu03:02:48

that works, but where the information will be stored, If someone else clone the repo, how can he got this configuration. should I commit .idea and *.iml?

cfleming03:02:12

I’m still not sure what the best solution is.

cfleming03:02:37

Eventually this will be handled with a public API and a repo users can contribute to.

cfleming03:02:51

But there’s also a need for project-specific customisations.

tianshu03:02:35

maybe a repo is not the solution for in-house macros. and commit configuration with project is somehow most convenient way for team.

tianshu04:02:37

The parinfer on Cursive works great, I prefer to use it with paredit.

tianshu11:02:55

does cursive have feature for aligning code?

(let [x    1
      yyyy 2]
  xx)

tianshu11:02:10

I thought it will format map literals, but not let binding form.

danielcompton12:02:40

Yep code style settings

danielcompton12:02:50

Align let bindings iirc

grav12:02:03

Is it possible to get IDEA to halt when a unit-test throws an exception?

cfleming20:02:25

@grav What do you mean “to halt” - to stop the running tests?

grav20:02:34

Halt is the wrong expression -I mean to leave me hanging in the debugger. Actually I did find kind of a solution, namely to enable breaking on all exception. But that means that all other exceptions also trigger the debugger

cemerick20:02:41

Is anyone using IdeaVim happily? AFAICT, it's…pretty poor

cemerick20:02:22

There's very positive comments about it here and there (and very strong reviews FWIW), so I wonder if there's something badly wrong in my env

grav20:02:50

@cfleming So for instance, running the foo-test below will break on both the handled and unhandled exception. I only want to break on the unhandled one in (defn foo …

grav20:02:55

(ns foo-test
  (:require [clojure.test :refer :all]))

(defn foo []
  (throw (Exception.))
  "foo")

(deftest foo-test
  (let [expected (try (throw (Exception.))
                      (catch Exception e "foo"))
        x (foo)]
    (is (= x expected))))

cfleming20:02:42

@cemerick I’m not a vim person myself, but I’ve heard “about the same level of emulation as evil-mode” from people who sound like they know what they’re talking about.

cfleming20:02:55

Are there specific things you’re missing?

cfleming20:02:17

@grav Ok, so you have an exception breakpoint set, right?

cfleming20:02:09

Go to Run-&gt;View Breakpoints…, then select your breakpoint. There are options there for only breaking on caught or uncaught exceptions.

cfleming20:02:17

Is that what you’re after?

cemerick20:02:59

@cfleming Interesting. I was using evil for some years, and I would not say that.

cemerick20:02:02

Really simple stuff seems missing and/or really wrong. %, d%, c%, all the specific bracket edit stuff (`ci[`, etc)

cemerick20:02:33

I know everyone has their own 80% of vim they use, but that seems like really basic things for any lisper using vim

cfleming20:02:05

I have it on my to-do list to figure out what all that stuff really means.

cfleming20:02:26

But I’m planning to patch IdeaVim to work better with Cursive at some point.

cemerick20:02:26

I ended up disabling it because it was frustrating enough (and slowed every typing action, a separate issue)

cfleming20:02:41

In particular, ESC in the REPL editor needs fixing.

cemerick20:02:50

never even got that far, honestly

cfleming20:02:58

Hmm, interesting.

cemerick20:02:00

even stuff for plain text editing, e.g. in .md buffers

cemerick20:02:07

gq was always a no-op, % never worked (again, outside of cursive buffers), and Shift-up or down bizarrely seemed mapped to something like-but-not-quite pageup/down

cemerick20:02:49

I've sort of made my peace with not having vim keybindings for Clojure stuff, but I sorely need to work out an alternative editor for things like markdown, etc

cemerick20:02:57

was hoping to make intellij a one-stop shop

cfleming20:02:59

If you like I can put you in touch with the guy I was talking to about it.

cfleming20:02:09

He may have solutions for you.

cemerick20:02:46

I have a week or two of serious heads-down to get through, not going to fart around with tools any

cfleming21:02:31

Ok, if you decide to try again let me know, I’m definitely interested in making the experience better, but am totally unqualified to do so on my own.

cyclocross21:02:16

@cemerick i’ve used ideavim for years outside of cursive for years without issues. At least for my 80% of vim 🙂

cyclocross21:02:23

% for instance works flawlessly for me. Ideavim in the repl is broken in many ways best i can tell. But i use paredit for clojure and turn off vim.

cemerick08:02:00

cyclocross: Interesting, okay. I guess I'll try again in a while.

cemerick08:02:05

how is performance? I felt significant keystroke response latency, esp moving around in normal mode.

cyclocross14:02:28

I’ve not had a performance problem with Ideavim, I see no lag whatsoever when moving around, searching, jumping to marks etc. I suspect your problems are from a plugin somewhere. Are you using just basic intellij with cursive?

cfleming21:02:52

@cyclocross Is IdeaVim in the REPL broken in more ways than just the ESC problem?

cfleming21:02:11

I know that’s pretty fundamental, but it’s the only problem I’m aware of there.

cyclocross21:02:08

@cfleming Y, it’s really hard to tell what else is wrong if anything, since i’m stuck in insert mode 🙂 But inserting text seems fine.