LoginSignup
6
4

More than 5 years have passed since last update.

Visual Studio Community for Macで改行コードを変更する

Posted at

There are inconsistent line endings in the 'Assets/XXX.cs' script. Some are Mac OS X (UNIX) and some are Windows. This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.

こんな感じでVisualStudioでスクリプトを作成すると、
Linux/MacとWindowsの改行コードが入り混じって警告が出る

解決方法

  1. Preferences/Source Code/Code Formatting/C# Source Codeを選択
  2. Use default settings from 'Text file'のチェックを外す
  3. Line endings: をUnix/Macに変更

Screen Shot 2018-07-27 at 12.07.50.png

ちなみに全体のCtrl-Iでやるフォーマットをかけてもすでに作成されたスクリプトには反映されないようなので、
反映させるために全体選択->コピー->ペーストをする必要があった
(もっといい方法ありそう...)

6
4
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
4