在方法參數調用與上述不正確對齊后返回時,我們對代碼格式的工作方式有一些麻煩)。目前在 AndroidStudio 3.2.1 中,但據我所知,它一直在這樣做。問題發生在 Kotlin 和 Java 中。我們不喜歡自動套用格式的功能。fun behaviourExample() { this.methodCall( lambda1 = { /*something*/ }, lambda2 = { /*somethingElse*/ } ) .map { "Line incorrectly indented" } .map { "I'd like the lines to be correctly indented" }}fun methodCall(lambda1: () -> Unit, lambda2: () -> Unit): String { return "otherThing"}我們想找到改變自動套用格式的參數,如下所示:map{}正確對齊關閉)fun behaviourExample() { this.methodCall( lambda1 = { /*something*/ }, lambda2 = { /*somethingElse*/ } ) .map { "Line correctly indented" } .map { "I'd like the lines to be correctly indented" }}與此同時,我們正在做的是在 之前返回methodCall,這并不漂亮,但有效。fun behaviourExample() { this .methodCall( lambda1 = { /*something*/ }, lambda2 = { /*somethingElse*/ } ) .map { "Line correctly indented but I don't like to be forced to add methodCall() in a new line" } .map { "I'd like the lines to be correctly indented" }}我們懷疑它應該在首選項 -> 代碼樣式 -> Kotlin 中的某個位置,但我們使用了一堆參數并沒有找到它
添加回答
舉報
0/150
提交
取消