0
0

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 1 year has passed since last update.

Visual StudioとVisual Assistの記号自動補完を停止する(閉じカッコ、コメント行のアスタリスク、.の->変換)

Last updated at Posted at 2024-06-14

概要

テキストエディタはなるべく入力した通りに入力されてほしい、そう思う幾つかのおせっかい機能を停止する方法をまとめました。

Visual Studioのテキストエディタはデフォルトで様々な記号を自動補完します。自動補完とは、たとえばカッコ開きを入力するとカッコ閉じ、コメント開始(/*)を入力するとコメント閉じが自動補完されます。
image.png

以下はC++の場合ですが、他の言語でも同様かと思います。

カッコ閉じやコメント閉じの自動補完を止める方法

Optionsを開き、Text Editor -> C/C++ -> General -> Settings にある Automatic brace completionを切ります。
image.png

Visual Assistの自動カッコ閉じを止める方法

Visual Assistにも同様の機能があり、以下のように Editor -> Insert () and closing } ) ] ' " のチェックを外すことで無効化できます。
image.png

コメント行の改行によるアスタリスク自動補完を止める方法

デフォルトでは、コメント行で改行すると以下のとおりアスタリスクが挿入されます。
image.png

Optionsを開き、Text Editor -> C/C++ -> Code Style -> Comments にある Insert existing comment style at the start of new lines when writing comments を切ります。
image.png

Visual Assistが.を->に変換するのを止める

以下Editor -> Convert dot to -> in C/C++はUnreal Engineのスマートポインタ操作でしばしば意図しない動作になるので止めます。例えば、TRefCountPtrやTWeakObjectPtrのIsValidメソッドを呼ぶ時、.を意図して入力したのにも関わらず->に変換されてしまいます。
image.png

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?