microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
100.3k stars 12.39k forks source link

Allow configuration of ts.server.maxFileSize #32420

Open pyoor opened 5 years ago

pyoor commented 5 years ago

Search Terms

configure maxFileSize
largeFileReferenced

Suggestion

Allow the maxFileSize property to be configurable.

Use Cases

Currently, when trying to import large JSON files, the Typescript Language Service fails to provide intellisense due to the maxFileSize limit being exceeded.

Examples

[Trace  - 10:29:07 AM] <semantic> Event received: largeFileReferenced (0).
Data: {
    "file": "/home/user/project/src/data.json",
    "fileSize": 6534662,
    "maxFileSize": 4194304
}

Checklist

My suggestion meets these guidelines:

riverar commented 8 months ago

Yep, just hit this one whilst working with a 43MB JSON file. Was pulling out my hair trying to debug:

Property 'xxx' does not exist on type '{}'. ts(2339)

Would be great if we could configure this. Or provide an alternate solution (e.g. should I be providing typings instead?)