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

Editor prompts me to configure exclude #9594

Closed
elsigh opened this issue Jul 21, 2016 · 51 comments
Closed

Editor prompts me to configure exclude #9594

elsigh opened this issue Jul 21, 2016 · 51 comments
Assignees
Labels
javascript JavaScript support issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@elsigh
Copy link

elsigh commented Jul 21, 2016

  • VSCode Version: 1.3.1
  • OS Version: Mac OSX El Capitan 10.11.5

Steps to Reproduce:

  1. Create a jsconfifg.json
    Here's mine:
{
    "compilerOptions": {
        "target": "ES6",
        "module": "es6"
    },
    "exclude": [
        "bower_components",
        "node_modules"
    ]
}
  1. VSCode continues to prompt me to configure excludes
    image
@kieferrm
Copy link
Member

@elsigh just checking: Your file is jsconfig.json, correct?

@elsigh
Copy link
Author

elsigh commented Jul 22, 2016

Indeed, jsconfig.json

When I click the bug it opens my jsoncfig.json file even.
But it is true that I have a lot of files in subdirectories there.

I'll see if it continues to happen as I'm pretty excited about using vscode going forward!

@jrieken
Copy link
Member

jrieken commented Jul 25, 2016

@elsigh Can you hover over the message and let me know what the full reading is? There should be more folders

@jrieken jrieken added javascript JavaScript support issues editor labels Jul 25, 2016
@elsigh
Copy link
Author

elsigh commented Jul 25, 2016

image

But that's my primary project working directory ;) I don't want to exculde it.

@jrieken
Copy link
Member

jrieken commented Jul 25, 2016

😄 that makes sense. The logic to compute the exclude suggestions isn't very smart and doesn't go deep. Meaning that when there is a large folder inside the ConsumerWeb folder we point to the parent only.

My question is if your project is actually that large or if this is caused by some dependencies or temp files (like ember serve easily creates 20mb of JS files)

@elsigh
Copy link
Author

elsigh commented Jul 25, 2016

That folder is 10MB of actual code and some images but there are no temp things / build artifacts. Is there a way to exclude particular directories within a folder (e.g. **/img/)?

I do also have a number of things excluded in files.exclude and search.exclude (the exact same things fwiw, which seems redundant) and Quick Open is reasonable at least.

@jrieken
Copy link
Member

jrieken commented Jul 25, 2016

Yeah, in jsconfig you cannot use glob patterns but you can spell out the full relative path to exclude things. Tho, by default the language brain only loads js and d.ts files. If with that you hit a limit there is only the option of multiple jsonfig files in subdirectories left...

@elsigh
Copy link
Author

elsigh commented Jul 25, 2016

Ok, then it sounds like I don't need to exclude image directories anyway (but that accounts for some of the 10MB I mentioned earlier). It does seem that once I dismiss this warning it shouldn't continue to come back to bother me.

@jrieken
Copy link
Member

jrieken commented Jul 25, 2016

Well, the problem is that language service is really struggling with large amount of files. Can you run wc -l 'find . -iname "*.js"' (' is actually a back tick) in a terminal to see with how many lines of JS code we are dealing? Or, iff possible, can you share the project with me?

@elsigh
Copy link
Author

elsigh commented Jul 25, 2016

I can't share the code with you, but here's the result for that directory:
29264 total

@jrieken jrieken added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label Jul 26, 2016
@jrieken
Copy link
Member

jrieken commented Jul 26, 2016

That should be OK. Today the warning is generated when there are more then 500 files. Once we adopt a newer version of TypeScript the language service will tell us more precisely when it has to much to chew on

@elsigh
Copy link
Author

elsigh commented Jul 26, 2016

Sorry, but as a user, that doesn't make sense to me. =)
The editor works fine enough for me.
I dismissed a prompt that is inactionable for me.
It comes back.
That just seems like an interaction bug.

@jrieken
Copy link
Member

jrieken commented Jul 27, 2016

I fully understand that this is a bad solution and I am sorry that you are hit by this.

Technical details are always bad for explaining bad user behaviour but let me try: Under the hood VS Code forks a separate process (tssserver.js) that handles all JavaScript (and TypeScript) requests like validation, completions etc. We talk to that 'server' via stdio using a defined protocol.
When the server is under heavy load caused by a large project (one monster file, 1000s tiny files) it just stops responding/starts crawling. There is no signal from the server that it encountered overload so we are forced to use what we got so far - the number of files... Our guesstimate is 500 files times 200loc in average resulting in 100000loc. We know that heuristic doesn't work when there are many tiny files or when there is a single giant file. We the very soon coming next version of tsserver it will do the counting (in bytes) and report overload when a certain threshold is reached (I believe 20MB of sources).

@sbromberger
Copy link

Sorry to pile on here, but I keep getting For better performance exclude folders with many files, like: '/client/' messages, but I'm already excluding client/node_modules and

$ find . | grep -v node_modules | wc -l
      44

I have

    "exclude": [
        "node_modules",
        "bower_components",
        "jspm_packages",
        "tmp",
        "temp"
    ]

in my jsconfig.json settings. Why does this message keep popping up, and what can I do to stop it?

@dmythro
Copy link

dmythro commented Nov 1, 2016

Have same issue: offers me to Configure Excludes, notice says "/node_modules/", but I have excluded them and everything don't need, like dist dir etc.

Tried both with slashes and without, same result.

@steve-ross
Copy link

FWIW if you also have a .vscode/settings.json it still complains...

// Place your settings in this file to overwrite default and user settings.
{
  // Configure glob patterns for excluding files and folders in searches. Inherits all glob patterns from the files.exclude setting.
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/.typings": true,
    "tags": true,
    "**/www": true,
    "**/sessions": true,
    "**/.meteor/**": true
  },
  // setup tabs / spaces
  "editor.tabSize": 2,
  // use spaces instead of tabs
  "editor.insertSpaces": true,
  "editor.detectIndentation": false
}

@girvo
Copy link

girvo commented Nov 22, 2016

I'm also having this issue:

{
  "compilerOptions": {
    "target": "es6",
    "module": "commonjs",
    "allowSyntheticDefaultImports": true
  },
  "compileOnSave": false,
  "exclude": [
    "node_modules",
    "__clientTemp"
  ]
}

And it still says "Configure Excludes" on my .js files; despite having set it!

Version 1.7.1 (1.7.1)
02611b40b24c9df2726ad8b33f5ef5f67ac30b44
2016-11-03T13:44:00.572Z

@jrieken jrieken assigned mjbvz and unassigned jrieken Nov 22, 2016
@mjbvz
Copy link
Contributor

mjbvz commented Dec 2, 2016

With #16355, the TypeScript server will now tell us when a project includes too many files. Before, we used our own logic on the VSCode to determine this.

The next insiders build should include this change. Please try it out and let us know if you notice any problems or have any suggestions on how things could be improved.

Thanks.

@mjbvz mjbvz closed this as completed Dec 2, 2016
@yorch
Copy link

yorch commented Jul 15, 2017

I keep getting the message To enable project-wide JavaScript/TypeScript language features, exclude large folders with source files that you do not work on. even though my jsconfig.json file is already configured.

image

// jsconfig.json
{
  "compilerOptions": {
    "experimentalDecorators": true
  },
  "exclude": [
    "build",
    "node_modules"
  ]
}

Any idea?

@andreiropotica
Copy link

Same issue here:

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

And my jsconfig.json is defined:

{
"exclude": [
"node_modules",
"components/bower",
"components/ie",
"components/other",
"dist",
".temp",
".vscode",
"localization",
"typings"
]
}

@senocular
Copy link

This problem has gotten much worse with the latest update. I'm seeing this warning appear repeatedly sometimes within a matter of seconds of each other. It seems to increase with navigator usage (though not directly, perhaps because the reaction is delayed).

@RobertYoung
Copy link

For anyone experiencing this with a tsconfig.json, this was being caused by the allowJs property in the config. Set allowJs to false.

{
  "compilerOptions": {
    "baseUrl": ".",
    "target": "es5",
    "module": "commonjs",
    "allowJs": false
  }
}

@mjbvz
Copy link
Contributor

mjbvz commented Jul 20, 2017

To track down which files are being included in your ts/js project:

  1. set "typescript.tsserver.log": "verbose"
  2. Restart vscode and reproduce the issue
  3. Run the Open TS Server log command
  4. Look in the tsserver.log file in the opened folder.

There should be lists of files printed as part of the logs. Look for files that are unexpectedly being included

@jbelmont
Copy link

I am also facing the same issue, I have the following jsConfig.json

{
    "compilerOptions": {
        "target": "es6",
        "experimentalDecorators": true
    },
    "exclude": [
        "node_modules",
        "bower_components",
        "tmp",
        "vendor",
        ".git",
        ".vscode",
        "dist",
        "addons",
        "scripts",
        "coverage"
    ]
}

Why does the allowjs property show up as invalid

@peabnuts123
Copy link

I had this issue but I gave my jsconfig.json another look and realised I was not excluding bower_components which took my number of files down to ~250ish from ~550ish. I believe this has stopped the warning, but I think there is a small change that vscode could introduce to make this less intrusive. For example, you could expose the file limit via a setting (letting users get themselves into trouble if they so wish) or perhaps add a setting to your workspace to disable the warning. My project has been functioning perfectly despite this warning so probably one of two things should happen:

  • Make the warning only happen when there is actually something to be warned about
    • i.e. accurately detect performance issues between the language server and vscode, instead of heuristically using "500 included files"
  • Allow users to acknowledge the warning and consciously circumvent it

As it stands, showing an unavoidable warning with such a large margin of error is probably not ideal.

@mjbvz
Copy link
Contributor

mjbvz commented Jul 31, 2017

@peabnuts123 we already do this on modern versions of TypeScript. The 500 file limit only applies if you are using TS < 2.1.3. Otherwise, the TypeScript server tells us when it cannot handle any more files.

@peabnuts123
Copy link

I may not be fully grasping how this works but I am not using TypeScript at all, I have a purely JavaScript project, and am using jsconfig.json. Running latest editor and stuff so I can't see why I'd be using any old runtimes

@mjbvz
Copy link
Contributor

mjbvz commented Jul 31, 2017

The typescript server powers our JavaScript language features as well. If you are only working in JS and have not configured "typescript.tsdk", you are already on the latest TS release so there should be nothing to worry about

@peabnuts123
Copy link

All of the above is true but I still get:

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

if I remove bower_components from my excludes (raising the .js file count to ~550, from ~300).
As far as I can tell, projectStatus.ts is still checking against a limit of 500. I cannot accurately determine what it actually does when this limit is hit, though.

@gnz00
Copy link

gnz00 commented Aug 1, 2017

I am getting this when using "extends" in my tsconfig.json,

tsconfig.base.json:

{
    ...
    "include": [
        "src/client/**/*"
    ]
}

src/tsconfig.json:

{
    "extends": "../tsconfig.base"
}

If I remove the src/tsconfig.json, VSCode will pick up tsconfig.base.json and stop producing the message. This has made VSCode unusable and should be a feature that we can disable.

@artboard-studio
Copy link

For me, the problem was my build folder, contained a source-map file which was 16MB, By adding the build folder to excludes list vscode stopped nagging.

@aznloren
Copy link

aznloren commented Aug 9, 2017

I fixed the problem by excluding the dist folder or whatever folder generated by webpack e.g.

"exclude": [
"node_modules",
"dist"
]

@the-spyke
Copy link

I've excluded build folder and it still pops up.

@artboard-studio
Copy link

@the-spyke yeah mine starting nagging again too :/

@rognstad
Copy link

I feel like this should be reopened.

@ghost
Copy link

ghost commented Sep 11, 2017

I have an ember-cli project that uses Typescript and am running into this error, sometimes several times a minute :/ . I've tried all relevant suggestions in this thread, to no avail. Which has made VS Code pretty unusable...

@peabnuts123
Copy link

I think this should be re-opened. I am working on a project that has >1000 js files in it, so vscode has started giving me this warning every time I open the project which is very disruptive. I have no way of disabling it, but my use-case is perfectly legitimate. That seems like a defect to me

@mjbvz
Copy link
Contributor

mjbvz commented Sep 11, 2017

If you are seeing this, please open a new issue. It's much easier to track instances of these sort of problems in separate issues since the root causes are often different

For the new issue, please describe your basic project layout and also try checking the TS Server log to see if any odd files are being included:

  1. Set "typescript.tsserver.log": "verbose"
  2. Reproduce the issue
  3. Run Open TS Server log in vscode
  4. In the tsserver.log file, there should be lists of all the files that are in your project. These are printed in blocks that look like:
Info 3182 [14:47:23.682] Project '/Users/matb/projects/TypeScript-TmLanguage/build/tsconfig.json' (Configured) 0
Info 3182 [14:47:23.682] 	/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.d.ts
	/Users/matb/projects/TypeScript-TmLanguage/build/node_modules/@types/js-yaml/index.d.ts
	/Users/matb/projects/TypeScript-TmLanguage/build/build.ts
	/Users/matb/projects/TypeScript-TmLanguage/build/index.d.ts
	/Users/matb/projects/TypeScript-TmLanguage/build/node_modules/@types/node/index.d.ts

Info 3182 [14:47:23.682] -----------------------------------------------
Info 3182 [14:47:23.682] Project '/dev/null/inferredProject2*' (Inferred) 1
Info 3182 [14:47:23.682] 	/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es6.d.ts
	/Users/matb/projects/TypeScript-TmLanguage/node_modules/xcson/lib/xcson.js
	/Users/matb/projects/TypeScript-TmLanguage/node_modules/typeof/index.js
	/Users/matb/projects/TypeScript-TmLanguage/node_modules/cson2yaml/lib/cson2yaml.js
	/Users/matb/projects/TypeScript-TmLanguage/index.js
	/Users/matb/Library/Caches/typescript/2.5/node_modules/@types/node/index.d.ts

Scan through these project lists to see if anything stands out

@peabnuts123
Copy link

I can open a new issue if necessary for visibility but it is exactly as described in this one, I am unsure if that's the right thing to do.

tsserver.log has the Project … (Configured) line that you have shown followed by about ~7 random files (I can't see how these 7 files are related). Further down, there is a section titled Sending request and then some JSON representing a large number of files, all the JS files in my project (>1000). From my understanding, this large number of files is triggering this warning, as described in the original issue.

@mjbvz
Copy link
Contributor

mjbvz commented Sep 11, 2017

Yes please open a new issue. This makes it easier to track the characteristics of just your project. 1000 files should not crash typescript unless the files are very large, so I suspect there is something else at play here

@senocular
Copy link

Did anyone create a new issue yet? I see this in 1.17 (insiders). For getting any work done I'm still on 1.13.1 since that was the last build where this wasn't a problem.

@peabnuts123
Copy link

No, sorry, I have not yet created a new issue. I think it is kind of generally related to my vscode chugging in general (due to a couple of related factors) which is triggering the TSServer to say that it is lagging.

@artboard-studio
Copy link

@senocular In my case the issue got resolved after 1.16.1 Not sure about 1.17 (insiders) but VSCode stopped nagging ever since 1.16.1.

@senocular
Copy link

@human-a I still see it with 1.16.1 too.

@Fasani
Copy link

Fasani commented Oct 5, 2017

How to disable this really annoying stupid warning?

@peabnuts123
Copy link

Improvements to 1.17 + resetting my PRAM seems to have entirely removed this issue for me. I think I've been facing a general swathe of performance issues that resetting my PRAM may have mitigated, and this was related to all of that.

@voltrevo
Copy link

voltrevo commented Oct 9, 2017

I'm also still getting this in 1.16.1. Been putting up with this longer than I can remember. My excludes are configured. We need a setting to make this message go away or set the heuristic file limit higher or... something.

Actually in my case it's this very similar message:
screen shot 2017-10-09 at 3 24 20 pm

@rpavlovs
Copy link

rpavlovs commented Oct 17, 2017

Same issue here. MacOS, VSCode 1.17.1

@Fasani
Copy link

Fasani commented Oct 18, 2017

I fixed this by just explicitly including what I needed rather than excluding hundreds of other folders:

"include": [ "userapp/static/js/" ]

@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 upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests