What’s Groovy about IntelliJ IDEA 2018.1?
IntelliJ IDEA 2018.1 is coming! With dozens of incredible new features and improvements added already; it’s time to put the icing on the cake and tell you about our enhanced support for Groovy, read on!
First of all, the ability to refactor Groovy files and Groovy modules has been extended. Now you have a new action, that might be very useful when you want to keep your code in Groovy and at the same time benefits from the static compilation. To save you from a lot of time migrating the existing Groovy code, this new refactoring annotates every groovy class in the scope with the @CompileStatic annotation. Also, the IDE will apply fixes with a view to keeping code correct.
This new refactoring action is available from the context menu in the Refactor | Convert to @CompileStatic.
The IDE adds the @CompileDynamic annotation to methods that depend on dynamic language features and which couldn’t be automatically converted.
The IntelliJ IDEA can also refactor your code in a number of ways, to make sure your groovy code will successfully compile statically:
- The IDE adds explicit type coercion when it’s required.
- The IDE adds explicit type to fields when they can be inferred from field initializers.
- The IDE adds an explicit return type to methods. Type will be inferred by data flow analysis of method’s body.
IntelliJ IDEA converts multiple assignments without list literals to assignments with list literals.
Also, now when you convert a Groovy class to a Java class, the IDE removes all groovy.transform.* annotations, e.g. the @CompileStatic annotations.
Additionally, the IDE now reports unnecessary import alias for Groovy files; this new warning works on static imports as well.
Subscribe to Blog updates
Top 10 UI Updates in IntelliJ IDEA for 2023
Hey there, fellow developers! Today, we want to share the most significant UI updates from 2023 that have transformed how IntelliJ IDEA looks and functions. New UI Of course, the highlight of our recent updates was the launch of our new, clean, and modern UI. This was first announced at the en…
The What, Why, and How of JPA Buddy in IntelliJ IDEA
Master JPA entity management with JPA Buddy in IntelliJ IDEA! Our latest article shows you how to simplify your workflow and reduce boilerplate code.
The Best of IntelliJ IDEA’s HTTP Client
In today's fast-paced tech world, easy and efficient management of web services and APIs is crucial. That's where IntelliJ IDEA's HTTP Client steps in, turning complex HTTP requests into a walk in the park. The HTTP Client is a feature-rich, text-based tool in IntelliJ IDEA Ultimate. It seamlessl…
Import Postman Collections to the HTTP Client
We know that many of you use Postman collections and want to stay in the flow while working with them. This means staying inside IntelliJ IDEA and not switching to a different app. Great news! You can now effortlessly transform Postman collections into .http and use them in the HTTP Client …