IntelliJ IDEA 14.1 EAP 140.2493.5 is Out

If you haven’t noticed yet, a fresh IntelliJ IDEA 14.1 EAP build is already available for download. In addition to bugfixes it also brings you enhanced Scratch Files feature. Scratch Files (Tools → New Scratch File) were introduced in IDEA 14.0 but now they become real files stored in IDE settings so they are shown in Project View, they survive IDE restarts and even can be executed:Executable Scratch

Get the new EAP build and share your feedback on our discussion forum or report any found bugs directly to the tracker.

Posted in EAP Releases, New Features | Tagged , | 12 Comments

What’s new for Plugin DevKit in IDEA 14

IntelliJ IDEA 14 comes with a number of nice little additions and improvements for plugin authors. Continue reading

Posted in New Features, Plugin Development | Leave a comment

New Refactorings Around the Call Hierarchy in IntelliJ IDEA 14.1

 

Sometimes it is convenient to work with all methods in a call hierarchy in the same way: add or remove a parameter throughout the entire call hierarchy, make the whole hierarchy static, or delete the whole call hierarchy completely.

IntelliJ IDEA 14.1 makes this process simpler.

  1. Change Signature

It’s probably not a very well-known feature that it’s possible (since IntelliJ IDEA 4?) to add a parameter or an exception to all methods in the call hierarchy with a single click:

Screen Shot 2015-01-14 at 10.03.26.png

Result is:

 

  1. Safe Delete Parameter

If a parameter is only passed through the call hierarchy and has no usages outside of it, Safe Delete will automatically suggest other methods in the hierarchy where the parameter could be deleted.

Screen Shot 2015-01-14 at 09.56.53.png

Selecting all methods would result in:

  1. Make Method Static

If you make some method static, and some of it’s callers do not contain any other references to instance members, IntelliJ IDEA will suggest these callers to make them also static.

Result:

 

  1. Safe Delete of Method Call Hierarchy

Much the same way, if you delete a method, Safe Delete automatically checks if some of the callees inside the methods body are no longer used and will suggest to delete them also – so you don’t need to apply Safe Delete for each method in the call hierarchy manually.

Result:

 

And all this without any additional actions to learn!

Posted in EAP Releases, New Features | Tagged , , | 1 Comment

Webinar Recording: Software Architecture as Code

The recording of our webinar with Simon Brown,  Software Architecture as Code,
is now available on JetBrains YouTube Channel, as well as select Q&A below.

Here are the slides used in the webinar and the code.

We’re still manually drawing software architecture diagrams in tools like Microsoft Visio. Furthermore, these diagrams often don’t reflect the implementation in code, and vice versa. This session with Simon Brown looks at why this happens and how to resolve the conflict between software architecture and code through the use of architecturally-evident coding styles and the representation of software architecture models as code.

01:28 – How do we communicate software architecture?
07:00 – Abstraction is about reducing detail
07:50 – Does your code reflect the abstractions you think about?
11:18 – Why not auto-generate the diagrams?
13:42 – The intersection of software architecture and code
14:08 – The C4 model
19:40 – A C4 example – techtribes.je
23:10 – The static model is about code
23:56 – Why isn’t the architecture in the code?
29:10 – Questions
32:10 – Software architecture as code demo with Structurizr
52:45 – Summary
53:40 – Questions

Select webinar questions and answers with Simon.

Continue reading

Posted in Webinars | Tagged , , | 3 Comments

Multiple Selections in Editor using the Mouse

As of IntelliJ IDEA 13.1, if you need to edit a document in the same way in several places, you can save efforts by using multiple selections feature. All you need to do is create a caret at each location using Alt+Shift+Mouse Click and make your changes – they will be applied at all locations simultaneously.

This however doesn’t solve the issue of wanting to select arbitrary selections of text before editing. This has now been solved in IDEA 14.1. You can drag the mouse while holding Alt+Shift and select the text required. This feature can also be used to copy-paste several pieces of text in one go.

multiSelection1

Similarly, you can now add a new rectangular selection to existing carets/selections by dragging the mouse while holding Ctrl+Alt+Shift (Cmd+Alt+Shift on Mac OS).

multiSelection2

Try this and other enhancements by downloading IntelliJ IDEA 14.1 EAP build. Share your feedback on the discussion forum and in our issue tracker.

Thanks!

Posted in EAP Releases, New Features | Tagged , | 10 Comments

Using Rich-Text Copy in IntelliJ IDEA 14.1

IntelliJ IDEA 14 added built-in support (without additional plugins required) for copying text to external rich-text editors such as MS Word, OpenOffice Writer, Gmail, etc. allowing for preserving formatting.

IntelliJ IDEA 14.1 makes it more flexible, allowing you to choose when to use this feature. You can choose to enable this behaviour by default when using the standard Copy action. All that’s need is to enable the following checkbox in Settings:

richTextCopy

With this enabled, if you want the old behaviour of standard copy (i.e. with no additional formatting)
you can use a separate action (Copy as Plain Text or Copy as Rich Text) from the Edit Menu entry or the editor’s context menu:

copyAsAction

These actions do not have default shortcuts assigned, but you define them in Keymap settings if you find yourselves using one of them often.

Try this and other enhancements by downloading IntelliJ IDEA 14.1 EAP build. Share your feedback on the discussion forum and in our issue tracker. Thanks!

Posted in EAP Releases, New Features, Tips & Tricks | Tagged , | 1 Comment

IntelliJ IDEA 14.1 EAP 140.2285.5 is Out

Today we have published a new IDEA 14.1 EAP build. It fixes many bugs found in the first EAP build and also includes new features and improvements. In particular it supports automatic setup of GWT facets for projects imported from Gradle and allows you to view differences in a more compact form:

Compact Diff Viewer

If you experience any problems or want to suggest a new feature, feel free to write to our discussion forum or file issues directly to the issue tracker.

Posted in EAP Releases, New Features | Tagged , | 12 Comments

Interview with Tor Norbye: the Present and the Future of Developer Tools for Android

Two months ago Google rolled out Android Studio, their brand new IDE for Android developers. The new IDE, built on top of IntelliJ IDEA Community Edition, has replaced ADT, a plugin for Eclipse, changing “developer experience” for millions of Android developers. As a member of the IntelliJ IDEA crew, I couldn’t miss a chance to discuss this “small revolution” with one of the Googlers behind it – meet Tor Norbye.

tor-photoAndrey: Before joining the ADT team at Google, where you’re working with Eclipse, you’ve also had quite a lot of experience with NetBeans at Sun Microsystems. I’m sure you know a lot about building tools for developers. Right now you’re working on Android Studio, a new IDE designed for Android developers, which is based on IntelliJ IDEA Community Edition.

Tor: That’s right – I’ve worked on developer tools for the last twenty years!

Andrey: Can you please share your impressions of Android Studio: what do you like about it, and what do you think makes it special and different from Eclipse and other IDEs? And, of course, we’d all like to hear your version of why IntelliJ IDEA became the final choice for building Android Studio on?

Continue reading

Posted in Interviews | Tagged , , , | 9 Comments

IntelliJ IDEA 14.1 Introduces Extract Functional Parameter Refactoring

              Extract Surrounding Method: You have two methods that contain nearly identical code. The variance is in the middle of the method. Extract the duplication into a method that accepts a block and yields back to the caller to execute the unique code.

Jay Fields, Shane Harvie

In Java, if we want to replace a block inside a method, the block should have a ‘known shape’ for surrounding code to be able to call it. Let’s perform a code transformation with the following example, step by step:

  1. Call Extract Method from the block to see the signature (make sure you cancel it afterwards). In our case the signature is  (int i) -> void

  1. Find an interface I, which could be implemented with this method

In our case, java.util.function.Consumer<Integer> with a shape (Integer) -> void will do.

  1. Wrap the code block with an anonymous class based on I:

  1. Extract the anonymous class as parameter.

The result will be:

Now we can pass different implementations of I to the surrounding method, though everything else remains the same. The only tricky part here is to find the interface I. This is how the new Extract Functional Parameter refactoring was born.

When you call this refactoring, it asks you to choose one of the available applicable functional interfaces, and then performs the rest automatically:

Screen Shot 2015-01-23 at 11.55.56.png

With the introduction of lambdas and method references, many functional interfaces were added. To distinguish them from sporadic single-method interfaces that could evolve, IntelliJ IDEA requires them to be marked with @FunctionalInterface or belong to well-known libraries (e.g. Guava, Apache Collections, etc.).

Extract Functional Parameter is already available in IntelliJ IDEA 14.1 EAP. Do give it a try and tell us what you think. Share your feedback on the discussion forum and in our issue tracker.

Develop with Pleasure!

Posted in EAP Releases, New Features | Tagged , | 7 Comments

Java Annotated Monthly – February 2015

In February’s edition of the Java Annotated, we’ll cover the latest JVM research, new developments from GWT and resources for mobile developers. On the Java Annotated Monthly, we travel far and wide to bring you the latest news from around the Java community. If you are interested in contributing, or would like to continue reading these stories in the future, let us know! Thanks for reading, and develop with pleasure.

jam_pic

Continue reading

Posted in News & Events | 5 Comments