https://kotlinlang.org logo
Title
c

Colton Idle

05/19/2023, 1:53 PM
Maybe I'm missing something basic... but is there a "refactor to new file" keyboard shortcut? Something I do all the time is build my screen with like 10 composables, and then I want to refactor them into separate files. Right now creating each file and then copy pasting is tedius.
m

mkrussel

05/19/2023, 1:57 PM
You can use the move refactoring.
t

Tgo1014

05/19/2023, 2:03 PM
What I do is to select the code, cut and paste into the folder I want it. It creates a new file with the content. ps: it don't work always 😅
c

Colton Idle

05/19/2023, 2:04 PM
let me try those two techniques
c

Chris Sinco [G]

05/19/2023, 3:45 PM
Refactor > Move… is the action. I believe it’s mapped to F6
Still have to do it with each file you want to create though
a

Advitiay Anand

05/19/2023, 4:35 PM
So we can't move to a file that doesn't exist?
b

Blundell

05/19/2023, 9:00 PM
yes you can
its all under F6