Whenever I refactor Kotlin code in Android Studio and I get an automatic suggestion to rename some class properties, the suggested names all start with
m
in the old Java naming convention:
mSomeProperty
.
Can I configure it somewhere that Kotlin refactoring doesn't use (obsolete) Java naming conventions?
Lukasz Kalnik
11/18/2022, 10:27 AM
In
Editor -> Code Style -> Kotlin
I don't see such a setting, only in
Code Style -> Java -> Code Generation
. I assume Kotlin takes it's settings for code generation for refactoring from there as well.
s
Stephan Schröder
11/19/2022, 12:26 PM
I have never encountered this suggestion. I assume your Java Style is custom made? Not that it should make a difference to Kotlin. As someone who has no knowledge of how refactoring is implemented, it seems buggy should the Kotlin refactoring rely on Java style 🤔
l
Lukasz Kalnik
11/19/2022, 12:32 PM
I don't have any custom Java style, nor have any Java code in project. It is 100% Kotlin.
But everytime I rename a class, and there are instances of this class in other Kotlin files/classes (as members), the suggestion pops up to rename these members as well starting with the