Fork me on GitHub
#cursive
<
2019-07-25
>
kenny00:07:44

The aliases folder in Clojure Deps appears to have gone away in 1.8.2-eap5-2019.2.

kenny00:07:50

Or am I crazy? It doesn't seem to be there...

kenny00:07:22

I think it's usually under the project name. I updated to 2019.2 on Ubuntu. This is a multi-module project.

kenny00:07:07

I tried specifying the aliases in the run configurations but all that does is pop open a Run window that says "java/sql/Timestamp".

cfleming03:07:40

@kenny Thanks, will check - 2019.2 has been a bit of a disaster for deps support, sorry.

4
caleb.macdonaldblack05:07:10

When I require the amazonica library in the repl, all of its functions are defined and I can autocomplete them. When I require in a standard clojure file they don't autocomplete. Can I standard clojure files to autocomplete like in the repl somehow?

tap09:07:23

Got the same "java/sql/Timestamp" error on Leiningen project

cfleming09:07:59

@caleb.macdonaldblack Did you get a prompt to create stubs for your project?

cfleming09:07:07

@tap can you send a screenshot of that?

cfleming10:07:45

@tap Thanks, which JDK are you using to run IntelliJ?

tap10:07:38

Interesting. I didn't realize I'm on java 11 for IntelliJ.

tap10:07:48

Will try with "2019.2 for macOS with Bundled JBR 8 (dmg)". Maybe it fixes the issue because my project is developing against java8.

mbjarland12:07:07

Quick question: assume I have a clojure script on disk as somefile.clj, it has no deps, and I don't want to create a project or a deps.edn as there are no dependencies and I would like to work in an ad-hoc manner by just opening the ifle. Is there a way to work with this file in cursive using a repl or am I forced to create a project?

mbjarland12:07:24

Just creating a "bare" clojure project and trying to send the file contents to a repl results in "Cannot load file into the active repl. It is not in scope for the module used to start the repl"

mbjarland12:07:17

or rather let me clarify, I would like to leave the file where it is and not set up a project structure with src etc, this is for ad how scripting to do stuff on the command line from clojure

cfleming22:07:01

Unfortunately IntelliJ doesn’t really work this way, it’s fundamentally project-focused.

mbjarland05:07:39

Yeah, now that I had time to mull things over, I think I might have asked this question before. Thanks for the reply. It’s a bit of a shame, I find myself quite often in an ad hoc situation where I just want to fire up an editor from the command line, run some repl stuff, save a file and breeze to the next thing. Anyway, thanks for the reply and thanks for Cursive, it is still the best clojure editor out there and is making my life easier on a daily basis.

cfleming22:07:46

Thanks for the kind words! Yes, it’s occasionally a pain, but it’s unfortunately just what IntelliJ is.

SgtZdog17:07:19

Hey guys, I think I've missed a setup step here, but I'm not sure how to fix it/what step I missed. (It's entirely possible there is actually something wrong with the code.) I keep getting "cannot find source class for java.util.map" (This generated by intellij/cursive debugger) How can I inspect my maps in the debugger? Or is there not a way to do so with Cursive?

SgtZdog17:07:09

In my REPL output while debugging: Error updating class definitions: NullPointerException java.util.concurrent.ConcurrentHashMap.get (ConcurrentHashMap.java:936)

salam17:07:06

maybe it's related to this? https://stackoverflow.com/questions/45654299/intellij-idea-unable-to-evaluate-the-expression-cannot-find-source-class-for-c take a look at your Project Structure | Platform Settings | SDKs and Project Settings | Project SDK.

SgtZdog17:07:13

I bow before your google-fu! More seriously, that does seem to have resolved the issue. I think maybe that setting got reverted when I did a separate install of intellij 2019.1.3

SgtZdog17:07:40

(since cursive release plugin isn't compatible with 2019.2

SgtZdog18:07:29

lol, those are great.

SgtZdog17:07:08

Separately, why does the debugger have 2 calls to functions? One normal and one as a static invoke? Is this a result of java needing everything to be in classes?

salam17:07:50

you're right, every single function in clojure is implemented as an individual java class. what you're seeing in the debugger is the spilling of the implementation details. there's a jira ticket to help mitigate this: https://clojure.atlassian.net/browse/CLJ-2456

SgtZdog17:07:20

ok, thought that was probably the case. ty for your help again

cfleming22:07:14

The root cause of this is tangentially discussed in that issue, but the problem is this: when compiling a Clojure function call, normally the function is implemented in a static method, and then the IFn is stored in a var. So the call goes: 1. Load IFn from var. 2. Call IFn, which calls static method. Those are the two steps you have to step through. I’m hoping to fix the debugger so this is not required.

SgtZdog22:07:29

Awesome, thanks!

tap18:07:16

Just to report back, I don't find my "java/sql/Timestamp" error on leiningen project issue on IntelliJ with java 8 bundled.

cfleming22:07:52

Awesome, thanks for letting me know.

antonmos20:07:33

@cfleming so, this not a cursive issue, right?

antonmos20:07:52

oh turns out that upgrading to s3-wagon-private “1.3.2” (from 1.3.1) fixes this as well

cfleming22:07:53

@U5CV9L3QV Well, sort of. The issue is that Cursive resolves lein projects in-process, so it always uses the JVM used to run IntelliJ itself. This is becoming more of a problem as we move on from Java 8 since later JVMs are more restrictive (modules etc)

cfleming22:07:16

Later versions of things like lein plugins will probably have fixes for these problems (like s3-wagon-private)

antonmos22:07:31

gotcha! thanks for the clarification

antonmos22:07:13

and thanks for Cursive! i am huge fan

cfleming22:07:33

Great! Glad it’s working well for you.

cfleming20:07:25

To those who experienced the NPE with deps under 2019.2, was that during project import or refreshing an existing project? Jetbrains over at https://youtrack.jetbrains.com/issue/IDEA-218954#comment=27-3608433 have suggested that a reimport might fix it.

salam20:07:19

i just got an NPE while re-importing an existing deps.edn project:

shaun-mahood21:07:58

Yeah, I only got that message when trying to import an existing deps.edn file. The only reason I tried that was because Cursive wasn't working at all for me on the existing one.

salam21:07:59

in my case, simply opening (not importing) an existing deps.edn project doesn’t throw that NPE but symbols are still unresolved which, i think, is a different issue.

shaun-mahood21:07:27

Yeah, same thing happens here

cfleming01:07:34

Ok, I’ll comment on the issue over there.

SgtZdog20:07:26

Hey! Cursive plugin updated so I can use release version of intellij! Yay!

SgtZdog21:07:11

How do I fix broken require statements? I have some methods which intellij can't resolve (thrown? for example)

kenny22:07:19

This is not an actual clojure function and is (probably) only used in conjunction with clojure.test. There's an issue for the clojure.test integration not resolving those symbols though: https://github.com/cursive-ide/cursive/issues/238

SgtZdog22:07:59

ah, fair enough then. thanks

genekim23:07:00

Agh. I can’t remember how to fix this — reaching out for help, after spending a half hour on this… I’m trying to start a REPL in a project using lein and deps.edn. I’m getting this error:

2019-07-25
16:28	Error reading /Users/genekim/src.local/gphotos1/project.clj
			Cannot run program "clojure" (in directory "/Users/genekim/src.local/gphotos1"): error=2, No such file or directory
			error=2, No such file or directory
I thought it was an issue with lein-deps-edn, and I think I even had this problem before. Somehow I fixed it before, I think after having stumbled upon this before: https://github.com/RickMoynihan/lein-tools-deps/pull/31 I upgraded to latest IntelliJ, thinking that was how I fixed it, but that doesn’t work. lein repl from command line works. In the REPL config screen, I see this error at the bottom, too.
Run Configuration Error: No Leiningen modules containing clojure.main found
Does anyone know how to fix this? Thank you in advance!!!

genekim23:07:59

Here’s my minimal project.clj file:

(defproject gphotos1 "0.1.0-SNAPSHOT"
  :min-lein-version "2.0.0"
  :plugins [[lein-ring "0.12.5"]
            [lein-tools-deps "0.4.5"]]
  :middleware [lein-tools-deps.plugin/resolve-dependencies-with-deps-edn]
  :lein-tools-deps/config {:config-files [:install :user :project]}
  :ring {:handler gphotos1.handler/app}
  :profiles
  {:dev {:dependencies [[ring/ring-mock "0.3.2"]]}
   :uberjar {:aot :all}}
  :uberjar-name "google-photos.jar"
  :main gphotos1.handler)

cfleming02:07:12

@U6VPZS1EK So, I’m not sure about this. The clojure.main message just means that your project hasn’t synced correctly, so Clojure is not attached as a dependency. The root cause is the earlier issue. It looks to me like you need to specify the full path to the clojure command explicitly to lein-tools-deps, maybe? I’m not sure.

genekim02:07:55

Thanks, @cfleming — I’m sitting down to try again!

genekim03:07:06

Fixed, @cfleming! You were right — adding this fixed the problem! Thank you!

:lein-tools-deps/config {
                           :config-files [:install :user :project]
                           :clojure-executables ["/usr/local/bin/clojure"]}

cfleming04:07:51

@U6VPZS1EK It’s a bit ugly, sorry 😞. This is due to the fact that Cursive resolves lein projects in-process, so the CWD is wrong. I do a bunch of black magic to hide that fact, but it doesn’t work for everything.

genekim04:07:47

Hey, I think Cursive and Clojure are freaking magical — like, a genuine technical marvel and miracle. You’ll never hear me complain about it!!! Thanks for all your great work, @cfleming!!! (And if I had to learn Emacs, I would have thrown in the towel long ago. :)

genekim06:07:02

Hmm. Adding the lein-tools-deps {:clojure-executables} causes a problem you push to Heroku, as Heroku installs the Clojure binary in /app/.heroku/clj/bin/clojure during runtime, but a temporary directory during build-time (e.g. /tmp/build_cbd87f5c06a1f53ce752790e2642e2a0/.heroku/ — presumably, this is in PATH environment variable. For now, I’ll just comment it out on laptop… Or use @U04VDQDDY suggestion of opening IntelliJ in the terminal window… But it does seem like getting a config that works for Cursive and lein-deps-edn for laptop and Heroku isn’t possible right now… (Sorry, just trying to organize my thoughts. Maybe I’ll file this as a new issue in lein-deps-edn. This person was having similar problems: https://github.com/RickMoynihan/lein-tools-deps/issues/79)