1
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 3 years have passed since last update.

vscodeで特定ファイルのworkspace上の監視を解除する方法

Last updated at Posted at 2021-04-26

はじめに

データ解析等をしている際にデータを含むディレクトリを直接プロジェクト上に含む際に以下のようなエラーを得ることがあります.

Visual Studio Code is unable to watch for file changes in this large workspace

このエラーの場当たり的な対応方法は監視できるファイル数の上限を増やすことですが,一般的にこのような対応方法は単純に動作不良や電力消費の上昇,速度下降等につながるため避けたいです.

そこである特定のファイルのみの変更・追跡を無視するようにする方法を記します.

方法

現在のworkspaceに .vscode/settings.jsonが存在しない場合はまず作成します.

$ cd <the path to the workspace>
$ mkdir .vscode/
$ touch .vscode/settings.json

次に以下の内容をsettings.json に加えます.

"files.watcherExclude": {
    "**/<the path to the file or directory to ignore>": true,
}

例:

"files.watcherExclude": {
    "**/data/**": true,
    "**/figure/**": true,
}

上記の方法により,vscodeのUI上で指定されたファイルやディレクトリが表示されなくなりますが,当然ファイルシステム上には残っているので実装上の問題は全く起こりません.

参考: User and Workspace Settings

1
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
1
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?