Repository: vscode
Issue: WORKSPACE_CONTAINS_TIMEOUT should be configurable
Labels: feature-request,extension-host

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->

I have `184` extensions been installed locally in my Visual Studio Code. Everytime I opened any of my project no matter what .NET or Java. I always have some extensions not loaded successfully. Here are the logs below:

![image](https://user-images.githubusercontent.com/88981/195034758-e6510ffe-65cd-4999-868d-0128f4d15a34.png)

```sh
[2022-10-11 15:30:09.991] [exthost] [info] Extension host with pid 34516 started
[2022-10-11 15:30:09.991] [exthost] [info] Skipping acquiring lock for c:\Users\User\AppData\Roaming\Code\User\workspaceStorage\a44950133c6b12cfe3ec40f1b43dcd53.
[2022-10-11 15:30:10.564] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: true, activationEvent: '*'
[2022-10-11 15:30:10.575] [exthost] [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git
[2022-10-11 15:30:10.586] [exthost] [info] ExtensionService#_doActivateExtension vscode.ipynb, startup: true, activationEvent: '*'
[2022-10-11 15:30:10.615] [exthost] [info] ExtensionService#_doActivateExtension christian-kohler.path-intellisense, startup: true, activationEvent: '*'
[2022-10-11 15:30:10.838] [exthost] [info] ExtensionService#_doActivateExtension doggy8088.netcore-snippets, startup: true, activationEvent: '*'
[2022-10-11 15:30:10.849] [exthost] [info] ExtensionService#_doActivateExtension EditorConfig.EditorConfig, startup: true, activationEvent: '*'
[2022-10-11 15:30:11.067] [exthost] [info] ExtensionService#_doActivateExtension emeraldwalk.RunOnSave, startup: true, activationEvent: '*'
[2022-10-11 15:30:11.077] [exthost] [info] ExtensionService#_doActivateExtension infinity1207.angular2-switcher, startup: true, activationEvent: '*'
[2022-10-11 15:30:11.106] [exthost] [info] ExtensionService#_doActivateExtension mhutchie.git-graph, startup: true, activationEvent: '*'
[2022-10-11 15:30:11.358] [exthost] [info] ExtensionService#_doActivateExtension ms-mssql.data-workspace-vscode, startup: true, activationEvent: '*'
[2022-10-11 15:30:11.474] [exthost] [info] ExtensionService#_doActivateExtension nhoizey.gremlins, startup: true, activationEvent: '*'
[2022-10-11 15:30:11.485] [exthost] [info] ExtensionService#_doActivateExtension oderwat.indent-rainbow, startup: true, activationEvent: '*'
[2022-10-11 15:30:11.495] [exthost] [info] ExtensionService#_doActivateExtension oouo-diogo-perdigao.docthis, startup: true, activationEvent: '*'
[2022-10-11 15:30:11.875] [exthost] [info] ExtensionService#_doActivateExtension wayou.vscode-todo-highlight, startup: true, activationEvent: '*'
[2022-10-11 15:30:11.896] [exthost] [info] ExtensionService#_doActivateExtension redhat.java, startup: true, activationEvent: 'workspaceContains:pom.xml'
[2022-10-11 15:30:12.072] [exthost] [info] ExtensionService#_doActivateExtension vscjava.vscode-java-dependency, startup: true, activationEvent: 'workspaceContains:pom.xml'
[2022-10-11 15:30:12.198] [exthost] [info] ExtensionService#_doActivateExtension vscjava.vscode-java-pack, startup: true, activationEvent: 'workspaceContains:pom.xml'
[2022-10-11 15:30:12.288] [exthost] [info] ExtensionService#_doActivateExtension vscjava.vscode-java-debug, startup: true, activationEvent: 'workspaceContains:pom.xml', root cause: vscjava.vscode-java-test
[2022-10-11 15:30:17.550] [exthost] [info] Not activating extension 'formulahendry.dotnet-test-explorer': Timed out while searching for 'workspaceContains' pattern **/*.csproj,**/*.fsproj
[2022-10-11 15:30:17.550] [exthost] [info] Not activating extension 'golang.go': Timed out while searching for 'workspaceContains' pattern *.go,*/*.go,*/*/*.go
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'ms-azuretools.vscode-azurefunctions': Timed out while searching for 'workspaceContains' pattern **/host.json
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'ms-azuretools.vscode-azurestaticwebapps': Timed out while searching for 'workspaceContains' pattern **/staticwebapp.config.json,**/swa-cli.config.json
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'ms-dotnettools.csharp': Timed out while searching for 'workspaceContains' pattern **/*.{csproj,sln,slnf,csx,cake}
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'ms-mssql.sql-database-projects-vscode': Timed out while searching for 'workspaceContains' pattern **/*.sqlproj
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'pranaygp.vscode-css-peek': Timed out while searching for 'workspaceContains' pattern **/*.css,**/*.scss,**/*.sass,**/*.less
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'redhat.fabric8-analytics': Timed out while searching for 'workspaceContains' pattern **/package.json,**/pom.xml,**/requirements.txt,**/go.mod
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'redhat.java': Timed out while searching for 'workspaceContains' pattern */pom.xml,*/build.gradle,*/settings.gradle,*/build.gradle.kts,*/settings.gradle.kts,*/.classpath
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'tintoy.msbuild-project-tools': Timed out while searching for 'workspaceContains' pattern **/*.*proj,**/*.props,**/*.targets
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'vscjava.vscode-java-pack': Timed out while searching for 'workspaceContains' pattern */pom.xml,*/build.gradle,*/settings.gradle,*/build.gradle.kts,*/settings.gradle.kts,*/.classpath
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'vscjava.vscode-java-test': Timed out while searching for 'workspaceContains' pattern */pom.xml,*/build.gradle,*/settings.gradle,*/build.gradle.kts,*/settings.gradle.kts,*/.classpath
[2022-10-11 15:30:17.551] [exthost] [info] Not activating extension 'vscjava.vscode-maven': Timed out while searching for 'workspaceContains' pattern **/pom.xml
[2022-10-11 15:30:18.892] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
[2022-10-11 15:30:18.910] [exthost] [info] ExtensionService#_doActivateExtension ms-mssql.mssql, startup: false, activationEvent: 'api', root cause: ms-mssql.data-workspace-vscode
[2022-10-11 15:30:23.791] [exthost] [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'
[2022-10-11 15:30:23.834] [exthost] [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'
[2022-10-11 15:30:24.172] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:24.180] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:24.184] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:24.196] [exthost] [info] ExtensionService#_doActivateExtension aaron-bond.better-comments, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:24.254] [exthost] [info] ExtensionService#_doActivateExtension cweijan.vscode-mysql-client2, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:24.844] [exthost] [info] ExtensionService#_doActivateExtension dbaeumer.vscode-eslint, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:24.905] [exthost] [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:25.390] [exthost] [info] ExtensionService#_doActivateExtension vscode.npm, startup: false, activationEvent: 'onStartupFinished', root cause: esbenp.prettier-vscode
[2022-10-11 15:30:25.401] [exthost] [info] ExtensionService#_doActivateExtension GitHub.copilot-nightly, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:25.581] [exthost] [info] ExtensionService#_doActivateExtension Gruntfuggly.todo-tree, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:25.762] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-containers, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:26.015] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:26.103] [exthost] [info] ExtensionService#_doActivateExtension nrwl.angular-console, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:26.832] [exthost] [info] ExtensionService#_doActivateExtension PKief.material-icon-theme, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:27.411] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'
[2022-10-11 15:30:27.678] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'api', root cause: nrwl.angular-console
[2022-10-11 15:30:28.287] [exthost] [info] ExtensionService#_doActivateExtension esbenp.prettier-vscode, startup: false, activationEvent: 'onStartupFinished'
[2022-10-11 15:30:28.786] [exthost] [warning] [redhat.java] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[java]', provide the URI of a resource or 'null' for any resource.
[2022-10-11 15:30:28.978] [exthost] [warning] [redhat.java] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[java]', provide the URI of a resource or 'null' for any resource.
[2022-10-11 15:30:32.285] [exthost] [info] ExtensionService#_doActivateExtension ms-mssql.sql-database-projects-vscode, startup: false, activationEvent: 'api', root cause: ms-mssql.data-workspace-vscode
[2022-10-11 15:30:47.360] [exthost] [info] ExtensionService#_doActivateExtension vscjava.vscode-lombok, startup: true, activationEvent: 'workspaceContains:pom.xml'
[2022-10-11 15:30:47.480] [exthost] [info] ExtensionService#_doActivateExtension vscjava.vscode-java-test, startup: true, activationEvent: 'workspaceContains:pom.xml'
[2022-10-11 15:30:48.255] [exthost] [info] Eager extensions activated
[2022-10-11 15:34:28.729] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing, startup: false, activationEvent: 'onLanguage:jsonc'
[2022-10-11 15:34:28.738] [exthost] [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
```

I saw this code snippet:

https://github.com/microsoft/vscode/blob/3f2adbfe3e6d07c60bc4c61b4ff7bdcf1c451792/src/vs/workbench/services/extensions/common/workspaceContains.ts#L90-L93

I realized the `WORKSPACE_CONTAINS_TIMEOUT` is a constant to `7000` only. It obvious not enough on my machine and it's not configurable.

https://github.com/microsoft/vscode/blob/3f2adbfe3e6d07c60bc4c61b4ff7bdcf1c451792/src/vs/workbench/services/extensions/common/workspaceContains.ts#L17

I'd like to suggest add a new config for this.

Related issue: https://github.com/microsoft/vscode/issues/18386