Joshua Pereira
Joshua Pereira

Reputation: 321

Too many active changes in VSCode

When there's a directory with a particularly large amount of files (ex. node_modules), VSCode will complain that there are too many active changes. It's simple enough to add the directory to .gitignore, however, the git tab in VSCode gets stuck loading, and I'm unable to view any relevant changes unless I completely restart VSCode.

Is there a way to refresh the git tab in VSCode without completely restarting the application? The refresh button at the top of the git tab seems to have no effect.

I'm using Microsoft's Remote Development extension if it makes any difference.

Upvotes: 5

Views: 1449

Answers (1)

Pierre
Pierre

Reputation: 2752

You can ask VSCode to totaly ignore some files/directories from being displayed/watched from your project.

To do so, at the root of your projects create a .vscode folder with a settings.json file in it. This file will contains VSCode related configuration proper to this project only.

In this settings.json, add:

{
    // Configure glob patterns for excluding files and folders.
    // For example, the File Explorer decides which files and folders to show or hide based on this setting. Refer to the `search.exclude` setting to define search-specific excludes.
    "files.exclude": {
        "**/node_modules/": true,
        "another_large_folder_to_ignore": true
    },
    // Configure paths or glob patterns to exclude from file watching.
    "files.watcherExclude": {
        "**/node_modules/": true,
        "another_large_folder_to_ignore": true
    },
    // Configure glob patterns for excluding files and folders in fulltext searches and quick open. Inherits all glob patterns from the `files.exclude` setting.
    "search.exclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    }
}

Full documentation: https://code.visualstudio.com/docs/getstarted/settings

Upvotes: 6

Related Questions