Fork me on GitHub
#cursive
<
2018-08-28
>
onetom06:08:14

i just created a new deps project by

mkdir xxx
cd xxx
echo '{:deps {org.clojure/clojure {:mvn/version "1.9.0"}}}' > deps.edn
idea .
and then just press next next next. my Preferences / Build Tools / Maven / Repositories list is empty. doesn't it supposed to have maven and clojars by default? i would like to use the package and version autocompletion in my deps.edn.

mhuebert09:08:43

Not sure if this is a bug per se — but these little hints don’t seem to appear for macros, only regular functions

wilkerlucio13:08:59

@cfleming on that, cljs also doesn't auto-complete macros, but once you type it it's recognized

wilkerlucio13:08:12

the same issue kind applies to auto-import, doesn't work when pointing to macros, but work for fns

cfleming21:08:20

@U066U8JQJ Hmm, that’s definitely a bug. I’m pretty busy right now but when I get a chance I’ll look at that.

cfleming10:08:03

@tap @suomi.esko I don’t think that’s possible - I don’t think I can override the class navigation. What you can do is rebind the actions, which I’ve done - I have Cmd-O goto Class, Shift-Cmd-O goto ns, Ctrl-Shift-O goto file.

tap11:08:01

Ah, that's perfectly solve my problem. Thanks!

cfleming10:08:17

@onetom That should work, I’ll try it tomorrow.

onetom14:08:59

I tried it on another machine and the default repo list was not present after importing the fresh project. (by idea . i meant Import Project from IntelliJ's opening screen and double clicking the deps.edn.

cfleming21:08:23

One question - do you have the Clojure CLI installed on those machines? The repos come from the system deps.edn, perhaps Cursive can’t find it for some reason?

onetom02:08:07

I do have a user-local installation, yes, so even outside of my project's nix-shell, i have clj on the $PATH.

$ clj -Sdescribe
{:version "1.9.0.391"
 :config-files ["/nix/store/m0qiv8040pxkybmcp7vhzl0q8ia6h5l3-clojure-1.9.0.391-prefix/deps.edn" "/Users/onetom/.clojure/deps.edn" "deps.edn" ]
 :install-dir "/nix/store/m0qiv8040pxkybmcp7vhzl0q8ia6h5l3-clojure-1.9.0.391-prefix"
 :config-dir "/Users/onetom/.clojure"
 :cache-dir ".cpcache"
 :force false
 :repro false
 :resolve-aliases ""
 :classpath-aliases ""
 :jvm-aliases ""
 :main-aliases ""
 :all-aliases ""}

onetom02:08:08

and you can see that the default repos are there too in the system deps.edn:

$ cat /nix/store/m0qiv8040pxkybmcp7vhzl0q8ia6h5l3-clojure-1.9.0.391-prefix/deps.edn
{
  :paths ["src"]

  :deps {
    org.clojure/clojure {:mvn/version "1.9.0"}
  }

  :aliases {
    :deps {:extra-deps {org.clojure/tools.deps.alpha {:mvn/version "0.5.442"}}}
    :test {:extra-paths ["test"]}
  }

  :mvn/repos {
    "central" {:url ""}
    "clojars" {:url ""}
  }
}

cfleming07:08:22

Ok, and Cursive is configured to find that executable, I assume?

onetom03:08:11

it seems correctly configured for me:

$ /nix/store/qxzhmfmv8k248m869icyfb2xnj2lc63b-clojure-1.9.0.391/bin/clojure -Sdescribe
{:version "1.9.0.391"
 :config-files ["/nix/store/m0qiv8040pxkybmcp7vhzl0q8ia6h5l3-clojure-1.9.0.391-prefix/deps.edn" "/Users/onetom/.clojure/deps.edn" "deps.edn" ]
 :install-dir "/nix/store/m0qiv8040pxkybmcp7vhzl0q8ia6h5l3-clojure-1.9.0.391-prefix"
 :config-dir "/Users/onetom/.clojure"
 :cache-dir ".cpcache"
 :force false
 :repro false
 :resolve-aliases ""
 :classpath-aliases ""
 :jvm-aliases ""
 :main-aliases ""
 :all-aliases ""}

onetom03:08:16

but clojure cli itself and its default config are in different directories, so you shouldn't derive the location of the deps.edn from the path of clojure or clj, but from the :install-dir in the output of clojure -Sdescribe.

cfleming21:08:55

Yes, I do that.

cfleming21:08:36

Hmm, I wonder what’s happening. I didn’t get a chance to try this the other day - I’ll try to look at this early next week.

cfleming10:08:45

@mhuebert That’s odd, that should definitely work.

mhuebert11:08:59

hm it doesn’t seem to work for any of my macros

csm20:08:43

“Quotes must be balanced inside comment blocks” orly?

cfleming20:08:25

@csm That’s a parinfer thing

csm20:08:31

my only complaint about that is that it checks after every keystroke, so when there’s an error (according to parinfer) it slows down the IDE a lot

justinlee21:08:59

is there a “close everything” action/key? would be super convenient when things get messed up

justinlee21:08:38

and my “everything” I mean all open parens, braces, and brackets

cfleming21:08:53

@lee.justin.m The problem with that is where to put the closers - it’s a surprisingly hard problem.

cfleming21:08:12

It’s basically what parinfer does, and parinfer uses indentation to figure out where the closing ones should go.

justinlee22:08:02

@cfleming i mean just close out all the way to the top level. it would only make sense at the end of a top-level form.

justinlee22:08:13

not something that you could do in the middle of a form

justinlee22:08:20

parinfer still gets badly confused on cut and paste sometimes, and I can generally fix things easily enough, but it is typically very annoying to fix the final close outs which can be something complicated like }])}]]))

cfleming22:08:38

@lee.justin.m Right, but what you’re proposing would have the same problem or worse, since parinfer at least does a reasonable job by using indentation.