Is there a way to auto-import extension functions ...
# compose
r
Is there a way to auto-import extension functions and properties without always having to press option + enter? What I've realized is that as soon as I press the option + enter, the import happens automatically before I even click on the import link so why is android studio not doing this automatically.
2
t
Personally I just enable auto suggestion as I type and choose what I want and it should be auto imported
r
This one here for instance is an unambiguous import so I would expect android studio to import it automatically.
👆 2
c
When you type it, if you use auto-complete, then it will do the import right then.
l
I would imagine they require you to press a keyboard shortcut to import to avoid extra weird imports from while you are typing. For example, if I want a LinearLayoutCompat, it would be weird for Android Studio to import LinearLayout if I happen to pause slightly while typing. It makes more sense to only import when you use auto-complete or press a keyboard shortcut, since it knows you are done typing then.
r
This is when you are done typing. after typing the first closing brace, I would expect android studio to automatically add the dp import. That is the default behaviour for classes and regular functions it's just very different with extension functions and properties.
c
Just type
.d
, auto-complete, press enter, and it will do the import itself. It works for everything.
r
It takes about 5 seconds for that popup to appear @CLOVIS
c
Ah. It is pretty much instant for me.
t
You can configure the delay in AS
r
how @Tin Tran
t
here’s my config
118 Views