Fork me on GitHub
#cursive
<
2018-04-10
>
cfleming00:04:04

@kingmob I’m not sure why :welcome wouldn’t be shown, since Cursive doesn’t mess with that part at all - perhaps it’s a REPLy thing? I’m not sure.

cfleming00:04:54

There isn’t an ns cleanup yet, although it’s one of the most regularly requested things so it’s near the top of my list. I’m slowly working through the list of cases required to make it work reliably in cljc, which is the main blocker.

kingmob00:04:31

Well, if you can make ns clean-up work in cljs, you’ll be ahead of CIDER. It routinely messed up converting :use to :require.

cfleming00:04:08

Nice to know - both clj and cljs are relatively easy, as is cljc if there are no reader conditionals.

cfleming00:04:38

Modern cljs actually requires far fewer of them, but the ns form is still one of the main places they’re used.

kingmob00:04:48

Only other caveat is, be careful removing unused namespaces from ns. Especially with foreign-libs, there can be included namespaces that have no obvious symbols referred to, so it’s easy to assume they’re unused. But they may supply js/ globals or even necessary polyfills.

kingmob00:04:45

BTW, would you suggest cljc as a way to mix cljs fns with their macros… or not?

tony.kay00:04:20

It depends. If you are writing cljs, and the only reason you need the clj is for a macro, then it can be ok; however, it gets really confusing to have them in the same file. I generally recommend keeping them separate. I beat my head against a wall for almost an entire day doing something that I saw in a file that I thought was written by David Nolen that combined them into a single file. Turns out it was a contrib that had a deeply confusing problem that neither the author nor David caught that combined them in a CLJC file in a way that was impossible to ever work. The reason it didn’t get caught is that the change was for an optimization…so everything looked to work when tested…it was just slower than intended.

cfleming00:04:56

Yeah, it can be hard to tell if a namespace is really required. In clj as well, an app can rely on load order (not a good idea, but apps can and do do it)

cfleming00:04:39

I’m probably not a great person to ask about your cljc question, since my use of cljs is very simple (I’ve never actually written a cljs macro)

kingmob00:04:01

@cfleming No worries, and thanks for all your help!

cfleming01:04:11

@kingmob Yes, :welcome is handled by REPLy, which Cursive bypasses altogether.

cfleming01:04:37

(or to be more accurate, lein converts that to :custom-help, which REPLy uses)

cfleming01:04:58

You could use a user.clj which prints your message, maybe?

kingmob02:04:47

Thx, I might try that

kingmob16:04:26

@cfleming Does “Find Usages” ignore profile-specific source paths? E.g., I have a fn that’s only used under env/dev/cljs/, which is only added in the :dev profile. If I run “Find Usages”, it won’t be found, but if I just do plain “Find”, it has no issues locating it.

justinlee18:04:03

hey has anybody upgraded intellij on mac? I’m scared to do it because when i upgraded from CE to UE, I lost all of my settings. If i just drag the icon into applications, is that going to work?

manutter5118:04:25

Yeah, I just upgraded to the latest IntelliJ that way, no problems. It asked if I wanted to import my old settings and I said Yes, and boom, ready to go

manutter5118:04:02

If you want a backup copy of everything you could re-name the old app and look for it’s data folder in ~/Library/Application Support

manutter5118:04:42

Looks like the App Support folders are all versioned though, so you should be safe.

manutter5118:04:13

(My version numbers go back to 2017.2, so maybe that’s a recent change)

justinlee19:04:19

great thanks. it’s working nicely

cfleming22:04:23

@kingmob Is env/dev/cljs marked as a source root, i.e. in blue in the project view?

kingmob22:04:25

Though env/prod/cljs wasn’t

cfleming22:04:33

Hmm, then I’m not sure why find usages wouldn’t find it.

cfleming22:04:06

Once a source path is marked as such, IntelliJ makes no distinction between them. The profile stuff only affects the actual import itself, i.e. which paths are marked as sources.

kingmob22:04:19

Wait, I think I figured it out. The same fn is coming from a different ns in dev. The real thing is only in prod. When I added the prod dir, “Find Usages” found it

cfleming22:04:38

Ah, that would explain it.

kingmob22:04:13

Do we need to be careful about specifying resources and exclusing output dirs?

cfleming22:04:18

Excluding output dirs is generally a good idea, yes, particularly with CLJS, since they get filled with gnarly JS code which IntelliJ will otherwise try to index.

kingmob22:04:45

Got it. Thx!

cfleming22:04:12

Resources are just slightly different source paths, really.