Importing multiple entries in a single line

Positions may change, right? :grin::sweat_smile::neutral_face:

I think there’s potential here for a more delightful developer experience for newer developers in particular—new to Kotlin, and new to the entire Java ecosystem. Figuring out “where stuff is declared” has typically been a challenge for me personally, especially when I began picking up Rust (and now I’m picking up Kotlin).

It would be nice to have a syntax like Rust’s use declarations

use std::option::Option::{Some, None};
use std::collections::hash_map::{self, HashMap};


 or ES6 imports


import { useEffect, useState } from "react";

Reasoning is:

  • I have no idea what’s inside:
import io.javalin.*
  • But this is clear as to what is being pulled into my current file
import io.javalin.Javalin
import io.javalin.apibuilder.ApiBuilder.get
import io.javalin.apibuilder.ApiBuilder.post
  • And [potentially] then this would be compact
import io.javalin.{Javalin, apiBuilder.ApiBuilder.{get, post}}


maybe that looks silly. :joy:

Just my 2 cents.

1 Like