Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

205
Visualizações
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 Respostas
Responde à pergunta

0

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

over 4 years ago · Santiago Trujillo Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda