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

458
Views
Automatically generated Kotlin code (from Java code) loses all blank lines, making the code uglier

When using IntelliJ IDEA's automatic Java -> Kotlin converter, the blank lines are lost, making the code not that readable. Is there an approach to avoid this or recover the blank lines?

For example,

line1;
line2;

line3;
line4;

may be converted to something without the blank line at the middle.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

As a workaround you may do the following:

  1. Replace all blank lines with some comment. You may do this by replacing
<Ctrl+Shift+Enter>
\s*
<Ctrl+Shift+Enter>

with

<Ctrl+Shift+Enter>
//newLine
<Ctrl+Shift+Enter>

(don't forget to turn on usage of regex):

enter image description here

  1. Convert file from Java->Kotlin
  2. Delete comment (replace it with empty string)
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!