Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Trace Viewer Preview - Type Complexity TracerNew to Visual Studio Code? Get it now.
Trace Viewer Preview - Type Complexity Tracer

Trace Viewer Preview - Type Complexity Tracer

Preview

Larry Layland

|
95 installs
| (0) | Free
A VSCode extension to measure type complexity within a project.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Preview of trace view integration into TsPerf Type Complexity Tracer

⚠️This is just a preview and will likely be removed once merged into the main project

Unless you are specifically wanting to test the preview, you should use the real extension published here: Visual Studio Marketplace Version

A VSCode extension to measure type complexity within a project.

🚧 It is a work in progress - help is wanted! 🚧

Real-time type checking estimates

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.

Trace file view and metrics

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.

Newest features may be unpolished, unstyled, or even broken

The goal of the preview is to get new functionality and data under the public eye as quickly as possible. There is much to learn about optimizing types and what data will be helpful to diagnose problems. Given that much of the data I can provide may not be useful, it seems best to let users decide what is useful and then polish that while dropping the extraneous information.

Credits

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

Credits

We are grateful to Algora for creating the TSPerf Type Challenge and to its sponsors.

Help wanted

  • Improve UX/API of the plugin - for example, more settings to customise how data is displayed to the user and better display of the traces
  • Investigate persistent worker threads that watch changes in a project and update asynchronously (and do not need to reinitialise TypeScript)
  • See if it is possible to get extended diagnostics or other diagnostic data from the compiler or tsserver APIs

License

Published under the MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft