簡體   English   中英

如何為注釋行應用縮進設置(IntelliJ IDEA / Android Studio)

[英]How to apply indentations settings for comment line (IntelliJ IDEA / Android Studio)

我當然知道如何使用行注釋快捷方式ctrl + / ,但由於某種原因,注釋從行尾開始。

如果我從這段代碼開始:

if (something) {
    return 5;
}

並使用 IntelliJ 的快捷方式,我最終得到:

if (something) {
//    return 5;
}

但我希望事情看起來像這樣:

if (something)
    // return 5;
}

有沒有辦法在 IntelliJ 中配置它? 我嘗試更改目標語言的代碼語法規則,但沒有任何改變。

可以在(Settings / Preferences -> Editor -> Code Style -> Java -> Code Generation)中更改此設置

選項:

  • Line comment at first column.

  • Block comment at first column.

它應該適用於 Android Studio 和 IntelliJ IDEA。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM