This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-25
Channels
- # 100-days-of-code (3)
- # beginners (80)
- # cider (53)
- # cljdoc (9)
- # cljs-dev (66)
- # cljsrn (6)
- # clojure (108)
- # clojure-austin (5)
- # clojure-dusseldorf (1)
- # clojure-italy (9)
- # clojure-losangeles (2)
- # clojure-nl (4)
- # clojure-spec (40)
- # clojure-uk (46)
- # clojurescript (60)
- # cursive (119)
- # datomic (28)
- # emacs (10)
- # events (1)
- # figwheel-main (21)
- # fulcro (16)
- # hyperfiddle (10)
- # immutant (2)
- # leiningen (1)
- # liberator (5)
- # nyc (1)
- # off-topic (36)
- # onyx (4)
- # pedestal (52)
- # portkey (5)
- # re-frame (11)
- # reagent (11)
- # shadow-cljs (46)
- # sql (1)
- # unrepl (2)
On a new laptop running Build #IU-182.4323.46, built on September 3, 2018 I installed Cursive 1.7.0-2018.2 and restarted IntelliJ as prompted. At IntelliJ startup I expect to be prompted for my Cursive license key but I’m not. In a new Leiningen project, when editing core.clj, I expect to see a “Cursive” menu item on the context menu but I don’t. I don’t see a way to open a REPL either.
Hi, Is it possible to make scratch files working with Cursive? I’m creating a clojure scratch files in IntelliJ. But auto-complete in scratch file doesn’t work. Everything else works fine - I can edit code and send it to REPL.
@kharus Unfortunately I think that’s still tricky, the scratch files are weird. I’ll try to fix that soon.
It’s more that the problem is loading into a namespace that you didn’t expect. Loading that namespace into the REPL will fix the problem, but may still be confusing if you’re not clear where your code is being loaded.
it works for me with that flag set, but when it's not I still get the error (even after 'Switch REPL NS to current file')
You need to load the namespace into the REPL or evaluate the ns
form to actually create the namespace. “Switch REPL NS…” just does in-ns
which has the problem described in that article.
But it really depends on where (in which namespace) you actually want your loaded code to end up.
@cfleming hello, I got situation where Cursive is complaining that I have a ciclic reference, but I dont, its a cljc file that requires the macros on itself for cljs,eg :
(ns com.wsscode.pathom.connect
#?(:cljs [:require-macros com.wsscode.pathom.connect])
(:require [clojure.spec.alpha :as s]
[com.wsscode.pathom.core :as p]
[com.wsscode.pathom.parser :as pp]
[com.wsscode.pathom.trace :as pt]
[clojure.math.combinatorics :as combo]
[#?(:clj com.wsscode.common.async-clj
:cljs com.wsscode.common.async-cljs)
:as p.async
:refer [let-chan go-promise go-catch <? <?maybe <!maybe]]
[clojure.set :as set]
[clojure.core.async :as async :refer [<! >! go put!]]))
it complains that com.wsscode.pathom.connect
requires com.wsscode.pathom.connect
, but that was always ok
now a bunch of comands don't work because Cursive don't want to run that (running tests for example)
@wilkerlucio I don’t think anything has changed with that code in a while - was Cursive ok with this namespace previously?
yes, it was, started the problem since the last EAP I think
this is a very common practice to do in cljc files to have macros available on CLJS from the file
the project is public, you can try yourself if you want: https://github.com/wilkerlucio/pathom/
and I'm running it though deps.edn (I only use lein to build the jar and publish)
@wilkerlucio Here’s the problem. That project depends on nubank/workspaces
, and that one depends on com.wsscode/pathom:2.0.4
. So this project depends on itself, and that is confusing things.
humm, gotcha, so I guess I can make some alias shuffling to get it to run witouht workspaces, I don't it on CLJ side anyway, thanks for looking it up!
You can use:
nubank/workspaces {:mvn/version "1.0.0-preview8"
:exclusions [com.wsscode/pathom]}
thanks, I didn't know :exclusions
works on deps, awesome!
I add the exclusions on the 2 places where workspaces is required but I still get the ciclic error
this is my launch config:
https://www.dropbox.com/s/kvsbxaucgpx8x8v/Screenshot%202018-09-25%2011.29.26.png?dl=0
is that correct?
its gone there: https://www.dropbox.com/s/cii543ubw4xppxi/Screenshot%202018-09-25%2011.31.15.png?dl=0
(I expanded the workspaces, not there too)
https://www.dropbox.com/s/syjcukewea184wx/Screenshot%202018-09-25%2011.32.17.png?dl=0
Ill try restarting intellij, just in case
I think I know whats wrong
I see it under Libraries on project, I still have that on the lein side, so that might be it
I only added lein because it keeps asking to do it when you open the project.clj
can we disasble that once deps is on?
I just removed the lein module, re-add the deps and tried over, but still complaining... I'm trying to restart IntelliJ now
yeah, I removed from that window
nope =/
https://www.dropbox.com/s/ozswu4xktmr6xg6/Screenshot%202018-09-25%2011.39.15.png?dl=0
got it, removing by hand from Libraries on the project
seem like it added back again when I refresh the deps project, which is strange given the exclusions is there
no, not at all in the deps dependencies
But now if you refresh your deps project from the deps toolwindow, the lib stays gone?
and I confirmed if I refresh the project I get it on external libs again
https://www.dropbox.com/s/ceoafcec3u1y51e/Screenshot%202018-09-25%2011.42.18.png?dl=0
The only think I can think of is that it might be deps classpath caching or something.
let me check
not there:
Wilker-Nu-2:pathom wilkerlucio$ clj -Spath -A:dev,:provided,:test,:http-drivers
src:/Users/wilkerlucio/.m2/repository/org/clojure/data.json/0.2.6/data.json-0.2.6.jar:/Users/wilkerlucio/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/Users/wilkerlucio/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar:/Users/wilkerlucio/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar:/Users/wilkerlucio/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/Users/wilkerlucio/.m2/repository/org/apache/httpcomponents/httpasyncclient/4.1.3/httpasyncclient-4.1.3.jar:/Users/wilkerlucio/.m2/repository/slingshot/slingshot/0.12.2/slingshot-0.12.2.jar:/Users/wilkerlucio/.m2/repository/org/apache/httpcomponents/httpcore-nio/4.4.6/httpcore-nio-4.4.6.jar:/Users/wilkerlucio/.m2/repository/spec-coerce/spec-coerce/1.0.0-alpha6/spec-coerce-1.0.0-alpha6.jar:/Users/wilkerlucio/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:/Users/wilkerlucio/.m2/repository/com/wsscode/spec-inspec/1.0.0-alpha2/spec-inspec-1.0.0-alpha2.jar:/Users/wilkerlucio/.m2/repository/clj-http/clj-http/3.8.0/clj-http-3.8.0.jar:/Users/wilkerlucio/.m2/repository/org/apache/httpcomponents/httpcore/4.4.9/httpcore-4.4.9.jar:/Users/wilkerlucio/.m2/repository/clj-tuple/clj-tuple/0.2.2/clj-tuple-0.2.2.jar:/Users/wilkerlucio/.m2/repository/riddley/riddley/0.1.12/riddley-0.1.12.jar:/Users/wilkerlucio/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/wilkerlucio/.m2/repository/org/apache/httpcomponents/httpclient/4.5.5/httpclient-4.5.5.jar:/Users/wilkerlucio/.m2/repository/org/clojure/math.combinatorics/0.1.4/math.combinatorics-0.1.4.jar:/Users/wilkerlucio/.m2/repository/potemkin/potemkin/0.4.4/potemkin-0.4.4.jar:/Users/wilkerlucio/.m2/repository/camel-snake-kebab/camel-snake-kebab/0.4.0/camel-snake-kebab-0.4.0.jar:/Users/wilkerlucio/.m2/repository/org/apache/httpcomponents/httpmime/4.5.5/httpmime-4.5.5.jar
I’m afraid I don’t know what more to suggest sorry, when I add those exclusions here it definitely gets removed and everything works.
might be some other type of cache, I'm starting trying cleaning the .idea
and starting over
is there any other place I might need to clean cache from?
and thanks a lot for hanging with me on this
Before trying that, try re-cloning the project and just importing the new copy, only using deps.
I just saw a pom.xml
there
when I re-imported it seemed to use maven and pathom was in the libs, my guess the pom.xml
was screwing things
no luck with that, still getting it, I'll try your suggestion and clone it again
there is some weird cache it seems
even if I completly remove the workspaces dep, pathom still shows up in External Libraries
no, new clone, same issue
yeah, the thing about removing the workspaces and it still living there is bizarre
cloned into a new folder
That is definitely what the problem is, but I can only :shrugemoji: as to what is actually going on.
no worries, should be something weird here, I'll try to clean some libs and try over again, I'll let you know if works out
I figured, the pathom
dep was coming from fulcro-inspect
actually, not workspaces, adding exclusion there fixed the dep issue
but weirdly, now it can't require core.async, CompilerException java.io.FileNotFoundException: Could not locate clojure/core/async__init.class or clojure/core/async.clj on classpath., compiling:(com/wsscode/pathom/core.cljc:1:1)
, but the core.async is present on the deps, cursive can navigate to it, sorry, too many problems I'm bringing on a batch XD
@cfleming I just got it working using IntelliJ classpath
but when I do via Deps on the REPL command menu, the core.async is not going on the classpath
but when I try via terminal using clj
it works (using same aliases)
one more hint: I works if I manually add the aliases to the REPL configuration, but the same aliases are already checked in the Aliases under deps menu, is expected to have to manually add those again to the deps run?
@wilkerlucio I don’t get it, why didn’t it appear in the classpath from the deps CLI then?
let me clarify, because I might just had a wrong assumption
Re: this: > I works if I manually add the aliases to the REPL configuration, but the same aliases are already checked in the Aliases under deps menu, is expected to have to manually add those again to the deps run?
Yes, it’s expected to have to add them to the run config. This is because you will probably want to use different aliases when running than when syncing your project.
yeah, that's were I find my assumption wrong, but it makes sense
if more people get this, might worth to add a note on the deps alias, something like (project aliases will not be considered, you have to add the ones you want)
thanks, I didn't know :exclusions
works on deps, awesome!
if I have a form like
(clj-time.coerce/from-sql-time (:some_key (first (korma/exec-raw ["select now() as some_key -- obfuscated"]))))
How can I get cursive to change it to:
(-> ["select now() as some_key -- obfuscated"]
korma/exec-raw
first
:some_key
clj-time.coerce/from-sql-time)
I know there's a Thread form
command, but no matter where I place the carrot, it seems to only thread the most narrow sexp?nevermind, immediately just figured it out after asking. Just run the command again in the next sexp up and it pulls it into the ->
form inside of it
I'm trying out cursive after having used emacs+cider for several years, so adjusting to a slightly different way of thinking in the editor. With cider & clj-refactor, you highlight the sexp you want put into the threaded form, so that is what I was expecting and couldn't get to work