A VSCode extension to measure type complexity within a project.
🚧 It is a work in progress - help is wanted! 🚧
To avoid the overhead of launching a separate tsserver, it currently queries the VSCode language server to get information about tokens in an open file, and uses the timings of the responses as a proxy for the complexity of the types, following the pattern of @definitelytyped/perf
.
The Tracer: tsc trace
command can be run to gather accurate timings. As with real-time metrics, these create diagnostics in the editor open files. It also opens an interface to browse trace files. Editor and UI commands enable navigating between locations in the editor and the trace.
If the trace is run with a version of tsc
that includes timestamps in types.json
, type count metrics are also displayed. A PR to include these timestamps or tooling to automatically patch them in are works in progress. See https://github.com/typeholes/TypeScript/tree/trace-data-5-4 for a version you can build yourself.
Better support for mono repos is on the roadmap. For now you can run traces for packages via the context menu in the file tree
We are grateful to Algora for creating the TSPerf Type Challenge and to its sponsors.
Published under the MIT License.