mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Add tracing support to tsserver (#41374)
* Add tracing support to tsserver Read the `TSS_TRACE` environment variable to determine which directory trace files should be written to. Notable changes from tsc tracing: 1) Drop all tracepoints that depend on type IDs 2) Write output to trace.PID.json 3) New, server-specific events (request/response, cancellation, etc) * Drop try-finally blocks that aren't strictly necessary * Fix lint error * Trace background work (for diagnostics) * Move try-finally blocks into session so tsc doesn't use them * Add missing try-finally * Use consistent capitalization * Inline canPop call where underlying variable is available * Clarify comments * Include PID in build-mode file names * Introduce more efficient popAll function * Trace throwIfCancellationRequested rather than isCancellationRequested * Remove unnecessary try-finally blocks * Add a command-line argument for consistency with logging * Fix rebase issues * Address PR feedback * Rename completionEvents to eventStack * Drop assertStackEmpty as hard-to-maintain and marginally valuable * Rename stepCancellation to stepCanceledEarly * Rename stepEarlyCancellation to stepCanceled and use flag instead * Check correct variable on exit
This commit is contained in:
@@ -780,7 +780,7 @@ namespace ts {
|
||||
// Track source files that are source files found by searching under node_modules, as these shouldn't be compiled.
|
||||
const sourceFilesFoundSearchingNodeModules = new Map<string, boolean>();
|
||||
|
||||
tracing.push(tracing.Phase.Program, "createProgram", {}, /*separateBeginAndEnd*/ true);
|
||||
tracing.push(tracing.Phase.Program, "createProgram", { configFilePath: options.configFilePath, rootDir: options.rootDir }, /*separateBeginAndEnd*/ true);
|
||||
performance.mark("beforeProgram");
|
||||
|
||||
const host = createProgramOptions.host || createCompilerHost(options);
|
||||
|
||||
Reference in New Issue
Block a user