Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode disable large folders warning #31188

Closed
amihaylov opened this issue Jul 21, 2017 · 11 comments
Closed

VSCode disable large folders warning #31188

amihaylov opened this issue Jul 21, 2017 · 11 comments
Assignees
Labels
javascript JavaScript support issues

Comments

@amihaylov
Copy link

Is there a way to disable the "To enable project-wide JavaScript/TypeScript language features, exclude large folders with source files that you do not work on." warning as it is displayed on each opening of files? I have configured jsconfig.json excluding folders such as node_moduels, but my source files are in the range of thousands. I couldnt find such option in the preferences so I guess it is a typescript option?

  • VSCode Version: 1.14.2
  • TS Version 2.4.1
@vscodebot vscodebot bot added new release javascript JavaScript support issues labels Jul 21, 2017
@mflux
Copy link

mflux commented Jul 23, 2017

I have this issue as well. VS code is showing this warning up to 5 times as I open the project and start skimming through files it's extremely annoying.

I have node_modules and the bundles excluded in the jsconfig as mentioned by other bug reports but it's still happening.

@paul-sachs
Copy link

Encountering to exact same issues. Excluding node_modules and other larger directories (dist, static, etc) does nothing. Warning persists.

@mjbvz
Copy link
Collaborator

mjbvz commented Jul 24, 2017

This warning means that TypeScript has disabled itself after trying to include too many files.

After adding the excludes, did you restart VSCode? Can you try looking in the TSServer log to see what files are being included:

  1. Set "typescript.tsserver.log": "verbose"
  2. Restart vscode
  3. Reproduce the issue
  4. Run the TypeScript: Open TSServer log command in VSCode
  5. Open the tsserver.log file

In the log file, look for blocks where file names are listed. For example:

Info 130  Project '/Users/matb/projects/vscode/extensions/typescript/tsconfig.json' (Configured) 0
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.d.ts
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es5.d.ts
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.reflect.d.ts
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.proxy.d.ts
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.promise.d.ts
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.iterable.d.ts
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.symbol.d.ts
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.generator.d.ts
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.collection.d.ts
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es2015.core.d.ts
/Users/matb/projects/vscode/extensions/typescript/src/protocol.const.ts
/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/protocol.d.ts
/Users/matb/projects/vscode/extensions/typescript/src/protocol.d.ts
/Users/matb/projects/vscode/extensions/typescript/node_modules/vscode-nls/lib/main.d.ts
/Users/matb/projects/vscode/extensions/typescript/src/utils/is.ts
/Users/matb/projects/vscode/extensions/typescript/src/utils/logger.ts
/Users/matb/projects/vscode/extensions/typescript/src/utils/electron.ts
/Users/matb/projects/vscode/extensions/typescript/src/utils/wireProtocol.ts
/Users/matb/projects/vscode/extensions/typescript/node_modules/@types/semver/index.d.ts
/Users/matb/projects/vscode/extensions/typescript/src/utils/api.ts
/Users/matb/projects/vscode/extensions/typescript/src/typescriptService.ts
/Users/matb/projects/vscode/extensions/typescript/src/utils/plugins.ts
...

Glance through these files and see if there are any unexpected files being included. Please share your tsconfig or jsconfig and the paths of some of the unexpectedly included files so that I can investigate

@mflux
Copy link

mflux commented Jul 25, 2017

Thanks @mjbvz I reproduced it and it looks like it's including node_modules

"c:/Users/Flux/Documents/Unreal Projects/CPCS/Content/Scripts/game/modules/meshgenerator/structure/shapes/setback.js",
"c:/Users/Flux/Documents/Unreal Projects/CPCS/Content/Scripts/game/modules/threejs_extra/SubdivisionModifier.js",
"c:/Users/Flux/Documents/Unreal Projects/CPCS/Content/Scripts/game/node_modules/abbrev/abbrev.js",
"c:/Users/Flux/Documents/Unreal Projects/CPCS/Content/Scripts/game/node_modules/acorn/dist/acorn_loose.es.js",
"c:/Users/Flux/Documents/Unreal Projects/CPCS/Content/Scripts/game/node_modules/acorn/dist/acorn_loose.js",
"c:/Users/Flux/Documents/Unreal Projects/CPCS/Content/Scripts/game/node_modules/acorn/dist/acorn.es.js",
"c:/Users/Flux/Documents/Unreal Projects/CPCS/Content/Scripts/game/node_modules/acorn/dist/acorn.js",
"c:/Users/Flux/Documents/Unreal Projects/CPCS/Content/Scripts/game/node_modules/acorn/dist/walk.es.js",

Despite my jsconfig.json declaring otherwise:

	{
		"compilerOptions": {
			"target": "ES6",
			"noLib": false,
			"charset": "utf8",
			"module": "es6"
		},
		"exclude": [
				"node_modules",
				"game/gameview.js",
				"game/gamecore.js"
		]
	}

Any ideas on why it's not excluded?

@mflux
Copy link

mflux commented Jul 25, 2017

I got it, node_modules is not root to my project. I think there's a misunderstanding on my part in how exclude decides to match the folder. I thought "node_modules" would exclude any folder or file named node_modules, regardless of depth to jsconfig.json.

I think to correct this confusion, the example in the documentation here: https://code.visualstudio.com/docs/languages/jsconfig should either

  1. make a note of the matching rules for folder and
  2. Include some kind of **node_modules wildcard directly in the example

@mjbvz
Copy link
Collaborator

mjbvz commented Jul 25, 2017

Thanks, I believe you are running into this bug: microsoft/TypeScript#12750

Try changing you exclude to "exclude": ["**/node_modules/*"]. I'm going to update the docs with the workaround

mjbvz added a commit to microsoft/vscode-docs that referenced this issue Jul 25, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Jul 25, 2017

I've updated the docs: microsoft/vscode-docs@4834f95

Let me know if you still see this issue after using the glob exclude for node_modules

@mjbvz mjbvz closed this as completed Jul 25, 2017
@amihaylov
Copy link
Author

Looks this worked for me as well.

@schreifels
Copy link

I'm also receiving this warning regularly, but it does not seem to be actionable for me. Our project has ~2400 JS files, not including any 3rd party code. I turned on verbose mode and verified that tsserver.log only outputs references to our files and that it had the same number of files I would expect.

Is TS Server just not able to handle this number of files? (For what it's worth, these are all source files; there are no bundles included in the glob.)

Any help would be appreciated. Thanks!

@aarongoldenthal
Copy link

With the glob exclude for node_modules I was still having this issue with every .js file that I opened. What eventually resolved it was updating jsconfig.json to exclude another large folder (~300 files) that I already had excluded in settings.json.

I expected settings.config exclusions to take precedence, then apply jsconfig.json exclusions, but it appears that's not the case.

@ericnoguchi
Copy link

ericnoguchi commented Oct 20, 2017

VSC 1.17.2
I still am getting this warning when opening js files

To enable project-wide JavaScript/TypeScript language features, exclude large folders with source files that you do not work on.

My jsconfig.js

{
    // This file is required for VSCode to understand webpack aliases
    "compilerOptions": {
        // This must be specified if "paths" is set
        "baseUrl": ".",
        // Relative to "baseUrl"
        "paths": {
            "common/utils": ["./somepath/*"]
        }
    },
    "exclude": [
        "**/node_modules/*",
        "**/webroots/*",
        "**/vendor/*",
        "**/Wpe/*",
        "**/scripts/*"
    ]
}

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

7 participants