Noldorin
Noldorin

Reputation: 147240

Disable VS Code warning "submodules which won't be opened automatically"

Every time I open a repo with a lot of submodules on VS Code, I get a pop-up message like:

The 'rust-devel' repository has 15 submodules which won't be opened automatically. You can still open each one individually by opening a file within.

Is there any way to disable this?

Upvotes: 14

Views: 5396

Answers (2)

bristweb
bristweb

Reputation: 1215

edit settings.json:

"git.detectSubmodules": false,
"git.detectSubmodulesLimit": 9999

The first one avoids the auto-detection, the second one gets rid of the warning. credit Probably best to set more reasonable in case 9999 may slow your machine. Couldn't seem to find any reasoning why the default is 10.

also see vs code defaults:

  // Controls whether to automatically detect git submodules.
  "git.detectSubmodules": true,

  // Controls the limit of git submodules detected.
  "git.detectSubmodulesLimit": 10,

Upvotes: 8

mplattner
mplattner

Reputation: 518

I didn't find a way to disable this warning. However there is a workaround: By increasing the Git: Detect Submodules Limit setting to a value higher than the number of submodules, the warning is not shown.

For example, this sets the limit to 30 via the VS Code settings.json file:

{
    "git.detectSubmodulesLimit": 30
}

Upvotes: 20

Related Questions