Track file extension in LSP request failure telemetry#3228
Draft
Track file extension in LSP request failure telemetry#3228
Conversation
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/803263bf-1fa1-433a-8720-e3be8e0dd918
Copilot
AI
changed the title
[WIP] Add file type tracking for failing requests
Track file extension in LSP request failure telemetry
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an LSP request panics and the server recovers, the telemetry event includes no information about which file type was involved, making it harder to identify JS-specific or extension-specific patterns in failures.
Changes
lsproto(generated + generator): Added optionalfileExtensionfield toRequestFailureTelemetryProperties. Field is*stringwithomitzeroso it's absent from the payload when not applicable.server.go: Updatedrecoverto accept afileExtension stringparameter. All three generic handler registrars (registerLanguageServiceDocumentRequestHandler,registerLanguageServiceWithAutoImportsRequestHandler,registerMultiProjectReferenceRequestHandler) now extract the extension viatspath.TryGetExtensionFromPath(params.TextDocumentURI().FileName())before the deferred call.handleCompletionItemResolveandhandleCodeLensResolvedo the same from their respective file references;handleWorkspaceSymbolpasses"".telemetryReporting.ts: AddedfileExtension?: stringtoLSErrorResponseto match.Example telemetry properties emitted on a panic in a
.jsfile:{ "errorCode": "-32603", "requestMethod": "textDocument.hover", "stack": "...", "fileExtension": ".js" }💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.