6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Android Studioで、ラインコメント(//)を行頭ではなくコードの開始位置に入れる方法

Last updated at Posted at 2016-09-11

この方法で設定できるのは、Javaファイルのみです。
同様のタブ/設定項目が存在しない言語は、(おそらく)設定できません。
例:xmlファイルなど。

##編集時(ショートカットキーの押下時)の設定
[設定箇所]
File/ Setting...
 Editor/ Code Style/ Java
  Code Generationタブ
   Comment Codeセクション
Line comment at first columnをオフにする。
(必要に応じて、Block comment~もオフにする。)

##コードフォーマット時の設定
[設定箇所]
File/ Setting...
 Editor/ Code Style/ Java
  Wrapping and Bracesタブ
   Keep when reformattingセクション
Comment at first columnをオフにする。

##参考
[Commenting and Uncommenting Blocks of Code]
Configuring commenting behavior
https://www.jetbrains.com/help/idea/2016.2/commenting-and-uncommenting-blocks-of-code.html#d1681359e22

[Stackoverflow - correct indentation in intellij]
http://stackoverflow.com/questions/9044472/correct-indentation-in-intellij

6
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?