Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
How can I rearrange Kotlin code in the order?

First of all, I Google it, and find no answer to this. Also, I've found some questions here, but they dated 2016 and 2017. Now we have 2019.

I'm used to Java in Android Studio. When I override methods, IDE puts them in order - how they placed in parent class or implemented interface.

Also when I'm developing, for example, Repository pattern:

  • I create an interface.

  • Create classes which implements this interface

  • When I am adding functions in interface and then I override (ctrl+o, or alt+Enter on class name) them in my classes: In Java they placed at the same position as they defined in my interface, In Kotlin - the placed in top of the class (this is really bad!)

Also, code does not get reformatted automatically, for example: global vars placed on top, then goes constructors, etc.

So I'm asking.

It's just me? I've tried deleting all Android Studio settings, reinstalling, etc. It did nothing. Also, Googling did not take any results.

Is there any solution to all of this? Because I really liked kotlin, but this inconvenience is just very annoying.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Android Studio/IntelliJ official doesn’t have support for the Kotlin code rearrangement.

over 4 years ago · Santiago Trujillo Report

0

Maybe this plugin Kotlin Code Sorter can fulfill your request. But this plugin only distinguishes the property, class, constructor or function. That the differences are inside some topics likes private, lateinit, val or var can not be order.

enter image description here

over 4 years ago · Santiago Trujillo Report

0

First select that code which you want to rearrange or reformatted. Than Just press ctrl+alt+L for rearrange or reformatted code.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!