feat(language-service): add perf tracing to LanguageService (#41319)

Adds perf tracing for the public methods in LanguageService. If the log level is verbose or higher,
trace performance results to the tsServer logger. This logger is implemented on the extension side
in angular/vscode-ng-language-service.

PR Close #41319
This commit is contained in:
Zach Arend
2021-03-19 07:56:13 -07:00
committed by Alex Rickabaugh
parent a371646a37
commit 90f85da2de
4 changed files with 240 additions and 138 deletions
@@ -110,6 +110,40 @@ export enum PerfPhase {
*/
LsReferencesAndRenames,
/**
* Time spent by the Angular Language Service calculating a "quick info" operation.
*/
LsQuickInfo,
/**
* Time spent by the Angular Language Service calculating a "get type definition" or "get
* definition" operation.
*/
LsDefinition,
/**
* Time spent by the Angular Language Service calculating a "get completions" (AKA autocomplete)
* operation.
*/
LsCompletions,
/**
* Time spent by the Angular Language Service calculating a "view template typecheck block"
* operation.
*/
LsTcb,
/**
* Time spent by the Angular Language Service calculating diagnostics.
*/
LsDiagnostics,
/**
* Time spent by the Angular Language Service calculating a "get component locations for template"
* operation.
*/
LsComponentLocations,
/**
* Tracks the number of `PerfPhase`s, and must appear at the end of the list.
*/