One of the most unexpected things for newcomers to IntelliJ is that you don't seem to have to save. Indeed, IntelliJ will automatically save either after a certain amount of time (15 sec of inactivity by default) or at certain critical points (when it loses focus, before you run something, etc). This is something that seems very strange to many people at first but most grow to love it. If not, you can disable it in Settings→Appearance & Behaviour→System Settings. If you make a change you'd like to revert, you can always use the Local History function.
As you're typing, Cursive will suggest autocompletions for the symbol you're currently typing. It will autocomplete symbols, keywords, namespaces and so forth. You'll be shown the parameters of functions and the namespaces that the symbols come from in the completion list. Pressing tab will choose the highlighted option (or the top option if none are selected) and replace the current symbol with it. Pressing enter will choose the highlighted option and insert its text directly, without removing the current symbol. Cursive will match the text you've typed anywhere in the completion text, it doesn't have to be at the start.
When you complete the name of a var using a namespace alias that isn't currently require
'd, Cursive will automatically
add a require
to your ns
form for you. Similarly, if Cursive sees an aliased var reference that it can't
currently resolve it will prompt you with options to require it.
These will also do what you'd expect in the REPL too.
Similarly to the var completions, when you complete the name of a class that isn't currently imported, Cursive will import it for you. If Cursive sees you've typed the name of a class it doesn't recognise it will prompt you with options to import it.
These will also do what you'd expect in the REPL too.
Cursive also allows you to rename symbols using Shift+F6 ( ). This will rename the symbol where it's defined as well as at all usage points.
This works across files too.
When implementing Java interfaces or extending classes with proxy
, Cursive can fill in stubs for the methods you need
to create for a particular class. There are two options - Implement Methods and Override Methods, and they're both
accessed from the Generate command (). In general, Implement
will present a list of all the methods you need to implement for a particular class, generally interface methods and
base class abstract methods. Then you can use Override to selectively override base class methods, either from the base
class in the case of a proxy, or from Object. This functionality is currently supported for proxy
, reify
,
defrecord
and deftype
.
Coming Soon: Implement functionality for protocols.
Cursive can also create a function implementation stub from an example usage. This will work both within the same file, and in another namespace.