Is there a button i can push to alphabetize my requires?
@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
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
I don’t think there’s any way to handle that, sorry.
No, AFAIK they work together well.
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?
especially if they are already using intelliJ for Scala development?
I welcome advice.
@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.
Students don’t have to pay for Cursive, there’s a free non-commercial licence covering that use case, among others.
and professors as well, I suppose. I will try it out to have a vague idea what it's like.
is there a danger of using cursive to edit a project which I otherwise develop using cider?
Ok, the userguide is here: https://cursive-ide.com/userguide/. Let me know if you or others have questions or issues.
do I risk destroying some of the meta-files if it try to edit the project with two different ides?
Yes - you may not want to go back to Emacs 🙂
Other than that you should be fine.
No, IntelliJ will create its project files in a .idea directory and it will all be self-contained in there.
being multi-lingual can only be good.
Definitely.
is that the wrong installation instructions? I see you recommended a different link.
No, if you follow the link from the homepage to the installation instructions you’ll end up at the userguide.
great. BTW, where is Settings->Plugins. I don't see it in my IntelliJ menu. "IntelliJ Ultimate" not "IntelliJ Community"
Ahh, I see it is in Preferences, not Settings.
If you’re on a Mac, it will… yes, that’s right. That differs by platform, unfortunately.
Do I need to both download cursive AND install the plugin?
You need to download and install IntelliJ, and then install the plugin (Cursive) from within the IDE.
I already have intelliJ installed.
I downloaded the license and the plugin/Cursive.
then I restarted intelliJ and opened up a clojure project, it looks sweet.
However, it never asked me to accept a license.
is that a bug?
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.
But everything will work, Cursive never disables anything due to lack of a licence.
that's polite and nonintrusive.
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.
but i see no such green triangle in the clojure file. Does that mean something is not installed correctly?
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
OK, I have a strange problem which seems to differ from the documentation https://cursive-ide.com/userguide/first-repl.html
the section Import Existing Project
I have imported the clojure cmd line tools. brew install clojure/tools/clojure
I see the dialog
When I press Next I see the following
and when I press Next here I see the following:
Is there a deps.edn file in that directory?
no. should there be?
can I check whether "deps" is installed properly?
Yes, that flow is for importing an existing project. If you want to create a new project you should use “new project”.
no, I have a project which was already created months ago with leiningen
Oh, so there’s a project.clj in that directory?
yes
So did you start this from the splash screen, or did you use File→New→Project from Existing Sources....?
File→New→Project from Existing Sources.
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.
It seems that recent cursive versions have issues with importing java classess:
It shows some java classes as unused even when they are used in the same file
ahhh.
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.
better image
!!!
seems to work. super
I selected Leiningen rather than Deps and with works great.
this applies only to some java classes:
I think this started in last 1-2 weeks
Hovering on classes says that “Instant cannot be resolved” etc
I’ll try to reproduce that tomorrow, thanks for the examples.
The latter example switched changed to this for some reason when i saved/modified whitespace
everything else seems to work as expected, it is only the coloring is wrong
I don't understand "Load File in REPL". is this supposed to load the file which is displayed in the editor?
I don't see that it has any effect.
Is there a hidden repl which is being loaded into?
I don't get the function rte-run-all-test
defined in the repl.
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?
There is an intelliJ bug about keyboard shortcuts with the mac.
https://youtrack.jetbrains.com/issue/IDEA-79144 the entire key sequence is not shown.
What is the keystroke for sending the current sexpr to the repl?
here is what I see on the menu indicating the shortcut, but that does not seem to be correct.
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
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.
@manutter51 how do I know whether it is active ?
There should be a checked checkbox to the right of the plugin name
Oh, click on the Installed tab in that window, the Marketplace tab is showing you available plugins.
Top center
hm.... seems to be clicked. right?
Yeah, that looks right
It’s not asking you to restart, so it should be there :thinking_face:
Do you have other plugins installed besides the ones that come standard with IntelliJ?
could be a restart issue perhaps.
I found the menu item in the mean time. not sure whether it magically appeared, or whether I was blind before.
Yes I have other plugins, the scala plugin is the main one.
Ah, ok, sounds like you’re back in business at least.
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?
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”)
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.
turns out it wasn't a key mapping issue. But rather cursive thinks there is a conflict and refuses to load the file.
🤯
👍
just a little bug. probably easy to fix.
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?
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.
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
You can also get his email from the plugin page on the IntelliJ site.
however, C-c C-c does seem to load the current form into the repl. That's a big help.
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
good advice, thanks.
Or you could sign up for the mailing list at cursive
(at-sign) <http://cursive-ide.com|cursive-ide.com>
in slime (common lisp) and also in cider C-c C-k compiles and loads the current file. That at least that's intuitive
Yeah, if you’re already used to that might as well keep it, assuming you can resolve the conflict.
you can report issues at https://github.com/cursive-ide/cursive/issues
Thanks, I found it. I reported the issue https://github.com/cursive-ide/cursive/issues/2433
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.
I am seeing similar behavior with Java classes: https://clojurians.slack.com/archives/C0744GXCJ/p1600337448171800