Fork me on GitHub
#cursive
<
2015-12-08
>
noonian21:12:33

I’m a total IntelliJ/Cursive noob. Is it possible to define custom indentation for macros used in cljs files (specifically om.next/defui)?

cfleming22:12:18

@noonian: which version of Cursive are you on? Very recent versions support defui and indent it correctly.

cfleming22:12:19

You can see that in Settings->Plugins

noonian22:12:51

@cfleming: I’m on 0.1.72-15, just installed IDEA 15 CE and the non development version of cursive

cfleming22:12:22

Interesting, how are you seeing defui indented? Can you send a screenshot?

noonian22:12:08

Well, I just opened a file that was already indented correctly, but emacs tab is treating it like a normal function it looks like

noonian22:12:12

but yea, 1 sec

cfleming22:12:26

Hmm, ok, there’s sometimes a difference between what reformatting the file does and what emacs tab does, which is annoying. There’s a bug there somewhere I haven’t managed to find.

noonian22:12:15

How can I test normal indentation? hitting enter form the top line puts the cursor at the same spot as emacs tab indents it to

cfleming22:12:30

Ok, see how defui is highlighted in yellow? That means that Cursive can’t resolve it, which means that it doesn’t know what the form is and it won’t indent it properly (or do anything else with it either).

cfleming22:12:38

How did you set this project up?

noonian22:12:06

I was trying to follow the “Importing an existing Leiningen project” instructions

cfleming22:12:43

Ok, can you open your leiningen toolwindow (View->Toolwindows->Leiningen) and see if your project is registered there?

cfleming22:12:15

If it isn’t, find the project.clj in the project window, right click, add as leiningen project.

noonian22:12:49

yes it is, and an om snapshot is also registered, maybe because I have a symlink in checkouts of my lein project?

noonian22:12:53

maybe thats messing it up

cfleming22:12:12

Could be, could you try removing the snapshot for a moment to see if that helps?

noonian22:12:25

k, removed the snapshots and restarted, hey its working now!

cfleming22:12:29

Remove the symlink, and then hit the refresh button in the lein toolwindow.

noonian22:12:57

@cfleming: thanks for your help!

cfleming22:12:13

@noonian: No worries, sorry for the hassle. I’ve filed https://github.com/cursiveclojure/cursive/issues/1188 so I don’t forget about it.

cfleming22:12:35

I’ll link to the log here when it appears.

noonian22:12:59

Ok, well I added back the checkouts and symlink and restarted and its still working so it may have been my system initializing or something or possibly because I had the checkout when I created the project from existing sources.

cfleming22:12:12

@noonian: Bizarre. I’ll look at that issue and see if I can reproduce, if not I’ll put it down to planet alignment.

noonian22:12:41

hehe, sounds good

rantingbob23:12:57

Is that generally the process by the way. I have a feature request, pretty minor I think (it might not be). Do we post them on GitHub?