This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-16
Channels
- # announcements (19)
- # babashka (13)
- # beginners (7)
- # calva (8)
- # cider (25)
- # clj-kondo (12)
- # cljsrn (7)
- # clojure (60)
- # clojure-australia (5)
- # clojure-europe (59)
- # clojure-france (14)
- # clojure-gamedev (2)
- # clojure-nl (1)
- # clojure-uk (7)
- # clojurescript (43)
- # community-development (8)
- # core-async (2)
- # cursive (15)
- # datomic (75)
- # deps-new (31)
- # depstar (1)
- # fulcro (6)
- # graalvm (53)
- # holy-lambda (1)
- # juxt (3)
- # jvm (13)
- # kaocha (8)
- # lsp (109)
- # malli (14)
- # off-topic (62)
- # pathom (11)
- # pedestal (12)
- # polylith (12)
- # releases (5)
- # sci (5)
- # shadow-cljs (15)
- # sql (16)
- # tools-deps (27)
- # vim (1)
- # xtdb (14)
as far as I'm aware the main limitation of cljfmt in this kind of thing is that it doesn't have a binary so you can't set up a file watcher for it, or if you do it might be quite slow. There are a couple of posts I found when researching trying to do the same thing (though we eventually just swapped to cljstyle instead). They aren't for cljfmt specifically but they should get you on the right track. https://bogoyavlensky.com/blog/clojure-formatting-cljstyle/ https://github.com/clj-kondo/clj-kondo/blob/master/doc/editor-integration.md#intellij-idea hope that helps!
this is one of the top voted issues: https://github.com/cursive-ide/cursive/issues/1403
Yea I read that and read the last comment, but couldn't figure out how the "works out of the box" thing actually works.
Any idea why cursive is not working for me? I’m getting this error:
com.intellij.execution.ExecutionException: Cannot execute - downloaded deps classpath not found:
/Users/calebmacdonaldblack/.m2/repository/org/clojure/tools.deps.alpha/0.12.1003/tools.deps.alpha-0.12.1003.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/resolver/maven-resolver-api/1.7.0/maven-resolver-api-1.7.0.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/resolver/maven-resolver-spi/1.7.0/maven-resolver-spi-1.7.0.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/resolver/maven-resolver-impl/1.7.0/maven-resolver-impl-1.7.0.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/resolver/maven-resolver-named-locks/1.7.0/maven-resolver-named-locks-1.7.0.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/resolver/maven-resolver-util/1.7.0/maven-resolver-util-1.7.0.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/resolver/maven-resolver-connector-basic/1.7.0/maven-resolver-connector-basic-1.7.0.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/resolver/maven-resolver-transport-file/1.7.0/maven-resolver-transport-file-1.7.0.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/resolver/maven-resolver-transport-http/1.7.0/maven-resolver-transport-http-1.7.0.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/maven-resolver-provider/3.8.1/maven-resolver-provider-3.8.1.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/maven-model/3.8.1/maven-model-3.8.1.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/maven-model-builder/3.8.1/maven-model-builder-3.8.1.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/maven-repository-metadata/3.8.1/maven-repository-metadata-3.8.1.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/maven-core/3.8.1/maven-core-3.8.1.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/maven-settings/3.8.1/maven-settings-3.8.1.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/maven-settings-builder/3.8.1/maven-settings-builder-3.8.1.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/maven-builder-support/3.8.1/maven-builder-support-3.8.1.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/maven-artifact/3.8.1/maven-artifact-3.8.1.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/maven-plugin-api/3.8.1/maven-plugin-api-3.8.1.jar
/Users/calebmacdonaldblack/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.2.1/maven-shared-utils-3.2.1.jar
/Users/calebmacdonaldblack/.m2/repository/com/google/inject/guice/4.2.1/guice-4.2.1-no_aop.jar
/Users/calebmacdonaldblack/.m2/repository/com/cognitect/aws/api/0.8.505/api-0.8.505.jar
/Users/calebmacdonaldblack/.m2/repository/com/cognitect/aws/endpoints/1.1.11.969/endpoints-1.1.11.969.jar
/Users/calebmacdonaldblack/.m2/repository/com/cognitect/aws/s3/811.2.858.0/s3-811.2.858.0.jar
at cursive.deps.DepsProjectsManager$Companion.classpath(DepsSupport.kt:173)
at cursive.deps.DepsProjectsManager$Companion.resourceConfigFile(DepsSupport.kt:128)
at cursive.deps.DepsProjectsManager$Companion.configFiles(DepsSupport.kt:84)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:164)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:85)
at cursive.build.BuildSystemProjectDetails.getProjectDetails(BuildSystem.kt:42)
at cursive.build.BuildSystemProjectsManager$reimportAllProjects$$inlined$synchronized$lambda$1.run(BuildSystemManager.kt:150)
at cursive.build.BuildSystemUtil$runTask$1$1.run(BuildSystemUtil.kt:93)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:998)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:497)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:228)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:228)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
I get this as soon as I open intellij. Even with a blank project deps.edn:
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.10.3"}}}
invalidate cache and restart does nothing
Okay so I just updated my tools.deps version and it started working. Not sure why it broke in the first place
is there any way to make cursive understand js/Promises? it really makes the code unintelligible …
What do you mean precisely by "understand"?
(-> (.resolve js/Promise 1) (.then #(+ 1 %) println)
resolve
, then
and js/Promise
symbols are not recognised.
did you try the steps from here? https://cursive-ide.com/userguide/troubleshooting.html
sure did.
Why do I get "submit cannot be resolved" on the proxy-super
call? This https://clojuredocs.org/clojure.core/proxy-super#example-5f746700e4b0b1e3652d73c5 explains that even (set! *warn-on-reflection* true)
would complain about it but that it can be fixed by adding type hint to the this
, which I do. I guess Cursive does not handle it in the same way?
(proxy [ThreadPoolExecutor] [^int 1 ^int 1 0 TimeUnit/MILLISECONDS 10 thread-factory]
(submit [^Runnable task]
(let [^ThreadPoolExecutor this this]
(proxy-super submit ^Runnable task))))
Is it possible to tell Cursive "Indent all unknown macros by 2 spaces"m instead of aligning with the first argument?