google / google/google-java-format

Intellij IDEA: Complete Statement action doesn't put the caret inside the method

オープン
#264 コメント 1 件 リアクション 1 件 担当者 1 名 @plumpy が担当を希望しています GitHub で見る
IntelliJ
主要言語
Java
スター
6.2k
フォーク
937
平均マージ
6分
マージ済み PR(30日)
3

説明

There's a feature in Intellij IDEA: _Complete Statement_. Start typing method declaration, like: `public void myMethod()` and press `Ctrl-Shift-A`, that will open curly braces and will put the caret inside those curly braces with respective indentation. So the code will look as follows:

```java
public void myMethod() {

}
```

But with `google-java-formatter` installed and enabled, version **1.5**, this shortcut and action doesn't open curly braces and doesn't put the caret inside the method. Instead, the code looks like follows when I press the shortcut after typing `... myMethod()`:

```java
public void myMethod() {}
```

So the method is closed and the caret is below outside the method.

The expected behaviour would be to open the curly braces and have the caret inside the method as was described in a first example.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。