This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-25
Channels
- # announcements (22)
- # architecture (6)
- # beginners (76)
- # cider (44)
- # clara (6)
- # clj-kondo (34)
- # cljdoc (4)
- # cljs-dev (8)
- # clojure (162)
- # clojure-brasil (4)
- # clojure-dev (32)
- # clojure-europe (3)
- # clojure-italy (16)
- # clojure-japan (4)
- # clojure-nl (3)
- # clojure-poland (1)
- # clojure-spec (25)
- # clojure-uk (45)
- # clojuredesign-podcast (5)
- # clojurescript (91)
- # clojutre (3)
- # core-async (19)
- # core-logic (8)
- # cursive (60)
- # data-science (3)
- # datomic (7)
- # defnpodcast (2)
- # duct (5)
- # emacs (7)
- # fulcro (1)
- # graalvm (9)
- # graphql (1)
- # jackdaw (12)
- # jobs (1)
- # jobs-discuss (1)
- # kaocha (3)
- # leiningen (3)
- # luminus (2)
- # off-topic (44)
- # onyx (17)
- # pathom (6)
- # planck (15)
- # re-frame (1)
- # reagent (13)
- # rum (2)
- # shadow-cljs (43)
- # spacemacs (3)
- # sql (43)
- # tools-deps (3)
- # vim (43)
- # xtdb (13)
I think it's usually under the project name. I updated to 2019.2 on Ubuntu. This is a multi-module project.
Yeah, it's usually there: https://cursive-ide.com/userguide/images/deps/toolwindow-aliases.png.
I tried specifying the aliases in the run configurations but all that does is pop open a Run window that says "java/sql/Timestamp".
@kenny Thanks, will check - 2019.2 has been a bit of a disaster for deps support, sorry.
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?
@caleb.macdonaldblack Did you get a prompt to create stubs for your project?
Will try with "2019.2 for macOS with Bundled JBR 8 (dmg)". Maybe it fixes the issue because my project is developing against java8.
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?
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"
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
Unfortunately IntelliJ doesn’t really work this way, it’s fundamentally project-focused.
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.
Thanks for the kind words! Yes, it’s occasionally a pain, but it’s unfortunately just what IntelliJ is.
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?
In my REPL output while debugging: Error updating class definitions: NullPointerException java.util.concurrent.ConcurrentHashMap.get (ConcurrentHashMap.java:936)
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.
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
i've read my books https://boyter.org/static/books/CiHHf9-UYAA6aVB.jpg https://boyter.org/static/books/pRDPMx2.jpg
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?
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
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.
Just to report back, I don't find my "java/sql/Timestamp" error on leiningen project issue on IntelliJ with java 8 bundled.
oh turns out that upgrading to s3-wagon-private “1.3.2” (from 1.3.1) fixes this as well
@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)
Later versions of things like lein plugins will probably have fixes for these problems (like s3-wagon-private)
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.
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.
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.
Yeah, same thing happens here
How do I fix broken require statements? I have some methods which intellij can't resolve (thrown? for example)
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
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!!!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)
@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.
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"]}
@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.
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. :)
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)
Just FYI: posted this here: https://github.com/RickMoynihan/lein-tools-deps/issues/79