cursive

Issues at: https://git.io/cursive-issues
emccue 2020-09-17T03:21:20.141900Z

Is there a button i can push to alphabetize my requires?

AJ Jaro 2020-09-17T15:40:32.198500Z

@emccue I put this plugin together to help address that problem. It’s super basic so I’m open to PRs to it as well on GitHub https://plugins.jetbrains.com/plugin/13222-clojure-namespace-sort

👍 1
dpsutton 2020-09-17T03:25:57.142600Z

my cursive coworkers will add a new line before the final closing paren, highlight all the imports and then hit sort lines. would be nice for this to be automated

cfleming 2020-09-17T04:31:16.143700Z

I don’t think there’s any way to handle that, sorry.

cfleming 2020-09-17T04:31:33.143900Z

No, AFAIK they work together well.

Jim Newton 2020-09-17T08:56:53.145Z

Hi, I am not a cursive user. rather I'm a cider user. However, some of my students ARE NOT emacs users. It is a good idea for me to recommend to them to use cursive?

Jim Newton 2020-09-17T08:57:11.145400Z

especially if they are already using intelliJ for Scala development?

Jim Newton 2020-09-17T08:57:18.145700Z

I welcome advice.

cfleming 2020-09-17T09:01:55.147700Z

@jimka.issy Obviously I’m biased, but I would say yes. Generally I recommend that new Clojure users use whatever they’re used to, so if that’s IntelliJ then sticking to that will make things easier for them. If they’re not either IntelliJ nor Emacs users I’d generally still recommend IntelliJ since it works in a more similar way to other apps they’re used to, but things like VSCode or Atom are also good options for that these days.

cfleming 2020-09-17T09:02:58.148200Z

Students don’t have to pay for Cursive, there’s a free non-commercial licence covering that use case, among others.

Jim Newton 2020-09-17T09:03:24.148800Z

and professors as well, I suppose. I will try it out to have a vague idea what it's like.

Jim Newton 2020-09-17T09:03:55.149700Z

is there a danger of using cursive to edit a project which I otherwise develop using cider?

cfleming 2020-09-17T09:04:17.150500Z

Ok, the userguide is here: https://cursive-ide.com/userguide/. Let me know if you or others have questions or issues.

Jim Newton 2020-09-17T09:04:19.150900Z

do I risk destroying some of the meta-files if it try to edit the project with two different ides?

cfleming 2020-09-17T09:04:28.151100Z

Yes - you may not want to go back to Emacs 🙂

cfleming 2020-09-17T09:04:33.151300Z

Other than that you should be fine.

cfleming 2020-09-17T09:05:04.152100Z

No, IntelliJ will create its project files in a .idea directory and it will all be self-contained in there.

Jim Newton 2020-09-17T09:05:06.152200Z

being multi-lingual can only be good.

cfleming 2020-09-17T09:05:12.152400Z

Definitely.

Jim Newton 2020-09-17T09:05:19.152600Z

https://cursive-ide.com

Jim Newton 2020-09-17T09:05:49.153300Z

is that the wrong installation instructions? I see you recommended a different link.

cfleming 2020-09-17T09:06:54.153900Z

No, if you follow the link from the homepage to the installation instructions you’ll end up at the userguide.

Jim Newton 2020-09-17T09:08:41.154500Z

great. BTW, where is Settings->Plugins. I don't see it in my IntelliJ menu. "IntelliJ Ultimate" not "IntelliJ Community"

Jim Newton 2020-09-17T09:09:48.155Z

Ahh, I see it is in Preferences, not Settings.

cfleming 2020-09-17T09:10:03.155400Z

If you’re on a Mac, it will… yes, that’s right. That differs by platform, unfortunately.

Jim Newton 2020-09-17T09:13:31.156Z

Do I need to both download cursive AND install the plugin?

cfleming 2020-09-17T09:14:00.156500Z

You need to download and install IntelliJ, and then install the plugin (Cursive) from within the IDE.

Jim Newton 2020-09-17T09:18:13.157Z

I already have intelliJ installed.

Jim Newton 2020-09-17T09:18:24.157300Z

I downloaded the license and the plugin/Cursive.

Jim Newton 2020-09-17T09:18:41.157800Z

then I restarted intelliJ and opened up a clojure project, it looks sweet.

Jim Newton 2020-09-17T09:18:53.158100Z

However, it never asked me to accept a license.

Jim Newton 2020-09-17T09:18:57.158300Z

is that a bug?

cfleming 2020-09-17T09:21:04.160Z

It should have popped up a notification in the bottom right corner. That will go away in a while if you don’t do anything about it, you can either find it in the event log or just not worry about it. Cursive is generally non-intrusive with respect to licensing, so if you don’t do it now it will gently nag you at some future point.

cfleming 2020-09-17T09:21:52.160400Z

But everything will work, Cursive never disables anything due to lack of a licence.

Jim Newton 2020-09-17T09:24:19.160700Z

that's polite and nonintrusive.

Jim Newton 2020-09-17T09:25:30.161700Z

OK, the first curious thing I notice. When I'm editing a scala project, and I view one of my test cases files, I see these little green triangles. I can click one of them to run a single test.

Jim Newton 2020-09-17T09:25:54.162400Z

but i see no such green triangle in the clojure file. Does that mean something is not installed correctly?

Jim Newton 2020-09-17T09:26:16.162500Z

cfleming 2020-09-17T09:42:15.163800Z

No, Cursive’s test integration works differently to most IntelliJ plugins because it’s REPL-based. I also need a standard test runner, but that’s not there yet. Here’s how the testing works in Cursive: https://cursive-ide.com/userguide/testing.html

Jim Newton 2020-09-17T09:57:25.164300Z

OK, I have a strange problem which seems to differ from the documentation https://cursive-ide.com/userguide/first-repl.html

Jim Newton 2020-09-17T09:57:53.164600Z

the section Import Existing Project

Jim Newton 2020-09-17T09:58:37.165Z

I have imported the clojure cmd line tools. brew install clojure/tools/clojure

Jim Newton 2020-09-17T10:00:44.165500Z

I see the dialog

Jim Newton 2020-09-17T10:01:19.166Z

When I press Next I see the following

Jim Newton 2020-09-17T10:02:03.166500Z

and when I press Next here I see the following:

cfleming 2020-09-17T10:02:19.167Z

Is there a deps.edn file in that directory?

Jim Newton 2020-09-17T10:02:49.167200Z

no. should there be?

Jim Newton 2020-09-17T10:03:15.167900Z

can I check whether "deps" is installed properly?

cfleming 2020-09-17T10:03:31.168300Z

Yes, that flow is for importing an existing project. If you want to create a new project you should use “new project”.

Jim Newton 2020-09-17T10:03:52.168700Z

no, I have a project which was already created months ago with leiningen

cfleming 2020-09-17T10:04:16.169Z

Oh, so there’s a project.clj in that directory?

Jim Newton 2020-09-17T10:04:21.169200Z

yes

cfleming 2020-09-17T10:06:13.170100Z

So did you start this from the splash screen, or did you use File→New→Project from Existing Sources....?

Jim Newton 2020-09-17T10:06:27.170300Z

File→New→Project from Existing Sources.

cfleming 2020-09-17T10:08:02.171100Z

So I think there’s a step before your first screenshot, which is “Import project from external model”. If your project is a Leiningen one, you have to specify Leiningen there, not Deps.

jsyrjala 2020-09-17T10:10:48.171800Z

It seems that recent cursive versions have issues with importing java classess:

jsyrjala 2020-09-17T10:11:01.171900Z

jsyrjala 2020-09-17T10:11:50.172300Z

It shows some java classes as unused even when they are used in the same file

Jim Newton 2020-09-17T10:12:04.172600Z

ahhh.

Jim Newton 2020-09-17T10:12:32.173200Z

I know that sometimes using Scala and the Scala plugin, from time to time intellij gets confused and I have to re-import from source.

jsyrjala 2020-09-17T10:13:19.173300Z

better image

Jim Newton 2020-09-17T10:13:22.173800Z

!!!

Jim Newton 2020-09-17T10:13:26.174Z

seems to work. super

Jim Newton 2020-09-17T10:14:27.174400Z

I selected Leiningen rather than Deps and with works great.

jsyrjala 2020-09-17T10:14:33.174500Z

this applies only to some java classes:

jsyrjala 2020-09-17T10:14:35.174700Z

jsyrjala 2020-09-17T10:15:35.175200Z

I think this started in last 1-2 weeks

jsyrjala 2020-09-17T10:17:24.175400Z

Hovering on classes says that “Instant cannot be resolved” etc

cfleming 2020-09-17T10:21:38.175600Z

I’ll try to reproduce that tomorrow, thanks for the examples.

jsyrjala 2020-09-17T10:24:48.175800Z

The latter example switched changed to this for some reason when i saved/modified whitespace

jsyrjala 2020-09-17T10:24:50.176Z

jsyrjala 2020-09-17T10:27:02.176500Z

everything else seems to work as expected, it is only the coloring is wrong

Jim Newton 2020-09-17T10:30:51.177100Z

I don't understand "Load File in REPL". is this supposed to load the file which is displayed in the editor?

Jim Newton 2020-09-17T10:31:09.177300Z

I don't see that it has any effect.

Jim Newton 2020-09-17T10:32:11.177700Z

Is there a hidden repl which is being loaded into?

Jim Newton 2020-09-17T10:33:21.177800Z

Jim Newton 2020-09-17T10:33:46.178400Z

I don't get the function rte-run-all-test defined in the repl.

Jim Newton 2020-09-17T11:42:57.179300Z

at the documentation link https://cursive-ide.com/userguide/repl.html#interaction-with-the-editor there is an animated graphic. https://cursive-ide.com/userguide/images/repl/editor-interaction.png , what is the user pressing to deliver those commands to the repl?

Jim Newton 2020-09-17T11:55:56.179800Z

There is an intelliJ bug about keyboard shortcuts with the mac.

Jim Newton 2020-09-17T11:56:30.180200Z

https://youtrack.jetbrains.com/issue/IDEA-79144 the entire key sequence is not shown.

Jim Newton 2020-09-17T11:56:51.180700Z

What is the keystroke for sending the current sexpr to the repl?

Jim Newton 2020-09-17T11:58:07.181100Z

here is what I see on the menu indicating the shortcut, but that does not seem to be correct.

Jim Newton 2020-09-17T13:14:08.182400Z

Does anyone know if there is a way to register the Cursive license when using IntelliJ Ultimate edition? The instructions in the email is to use Help -> Register Cursive. But that does not seem to exist in my IntelliJ

2020-09-17T13:16:56.183500Z

I have IntelliJ “Ultimate” on Mac OS, and it’s there, at the bottom. Maybe check under Preferences -> Plugins and make sure Cursive is active? If it’s not active, you won’t get the Register menu option.

Jim Newton 2020-09-17T13:21:11.183800Z

@manutter51 how do I know whether it is active ?

Jim Newton 2020-09-17T13:21:57.184100Z

2020-09-17T13:21:58.184400Z

There should be a checked checkbox to the right of the plugin name

2020-09-17T13:22:39.185100Z

Oh, click on the Installed tab in that window, the Marketplace tab is showing you available plugins.

2020-09-17T13:23:02.185300Z

Top center

Jim Newton 2020-09-17T13:23:47.185600Z

hm.... seems to be clicked. right?

2020-09-17T13:24:10.186100Z

Yeah, that looks right

2020-09-17T13:24:32.186500Z

It’s not asking you to restart, so it should be there :thinking_face:

2020-09-17T13:25:13.187Z

Do you have other plugins installed besides the ones that come standard with IntelliJ?

Jim Newton 2020-09-17T13:26:01.187200Z

could be a restart issue perhaps.

Jim Newton 2020-09-17T13:26:16.187600Z

I found the menu item in the mean time. not sure whether it magically appeared, or whether I was blind before.

Jim Newton 2020-09-17T13:26:37.187900Z

Yes I have other plugins, the scala plugin is the main one.

2020-09-17T13:27:22.188300Z

Ah, ok, sounds like you’re back in business at least.

Jim Newton 2020-09-17T13:27:54.189Z

cool. BTW what keys do I need to press to reload a file into the repl, or to re-eval the current top-level form?

2020-09-17T13:30:38.190500Z

I could never remember the default keys, so I went into Preferences -> Keymap and defined my own (Cmd-Shift-L for “Load file in REPL” and Cmd-Shift-Enter for “Load form before cursor”)

2020-09-17T13:31:33.191500Z

Also if you look at the top in the KeyMap prefs pane, there’s a dropdown menu with a list of common key bindings for those who are used to other editors, might be something there you’d like.

Jim Newton 2020-09-18T17:11:03.007400Z

turns out it wasn't a key mapping issue. But rather cursive thinks there is a conflict and refuses to load the file.

2020-09-18T17:25:21.007600Z

🤯

Jim Newton 2020-09-18T17:27:07.007800Z

👍

Jim Newton 2020-09-18T17:27:22.008Z

just a little bug. probably easy to fix.

Jim Newton 2020-09-17T13:32:49.192700Z

I ran the menu item REPL->Type Check Current NS and it gives some innocuous wrong information. Where's the best place to report this?

2020-09-17T13:35:46.193500Z

Hmm, maybe ping cfleming here. He’s on New Zealand time, so he may not see it right away if you’re posting from a US timezone.

Jim Newton 2020-09-17T13:37:09.194600Z

yes I took a look at that but I don't really understand how to use it. For example I see "Load File in Repl" is C-c C-k. However, when I press C-c C-k, it does not load the file but rather shows me the dependency list in a huge pink popup

2020-09-17T13:37:10.195Z

You can also get his email from the plugin page on the IntelliJ site.

Jim Newton 2020-09-17T13:38:26.195100Z

however, C-c C-c does seem to load the current form into the repl. That's a big help.

2020-09-17T13:38:38.195300Z

Sounds like a key mapping conflict. I’d try changing it to something else, and then changing it back. The IDE will tell you if you specify a key mapping that conflicts with something else, and I believe it tells you what the conflicting command(s) would be

Jim Newton 2020-09-17T13:39:15.195600Z

good advice, thanks.

👍 1
2020-09-17T13:39:38.196200Z

Or you could sign up for the mailing list at cursive (at-sign) <http://cursive-ide.com|cursive-ide.com>

Jim Newton 2020-09-17T13:39:57.196400Z

in slime (common lisp) and also in cider C-c C-k compiles and loads the current file. That at least that's intuitive

2020-09-17T13:40:36.196600Z

Yeah, if you’re already used to that might as well keep it, assuming you can resolve the conflict.

alexmiller 2020-09-17T13:56:31.196900Z

you can report issues at https://github.com/cursive-ide/cursive/issues

Jim Newton 2020-09-17T13:58:56.197200Z

Thanks, I found it. I reported the issue https://github.com/cursive-ide/cursive/issues/2433

Jim Newton 2020-09-17T13:59:34.198Z

not sure what's the best way to make a MWE (minimum working example) because a single file doesn't suffice. eventually you need an entire project directory structure.

jsyrjala 2020-09-17T14:30:47.198300Z

I am seeing similar behavior with Java classes: https://clojurians.slack.com/archives/C0744GXCJ/p1600337448171800