Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds opt-in telemetry emission from the native TypeScript language server to help measure project characteristics and ongoing runtime/performance behavior (memory/GC/auto-import stats), with a new initialization option to enable/disable telemetry.
Changes:
- Introduces
enableTelemetryinitialization option and plumbs it through LSP server → project session. - Adds new telemetry event shapes (
projectInfo,performanceStats) to lsproto and sends them frominternal/project/session.go. - Adds a cross-platform system memory dependency and updates mocks/tests for the expanded
project.Clientinterface.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/testutil/projecttestutil/clientmock_generated.go | Updates generated client mock to support SendTelemetry. |
| internal/project/session.go | Implements periodic performance telemetry and one-time project info telemetry; adds telemetry option and session start time. |
| internal/project/extendedconfigcache_test.go | Updates test client to satisfy new project.Client interface (SendTelemetry). |
| internal/project/client.go | Extends project.Client with SendTelemetry. |
| internal/lsp/server.go | Implements SendTelemetry on the server and wires enableTelemetry init option into session options and panic telemetry gating. |
| internal/lsp/lsproto/lsp_generated.go | Adds new telemetry event types/unions and enableTelemetry initialization option to generated protocol types. |
| internal/lsp/lsproto/_generate/generate.mts | Updates generator model with new telemetry events and validates telemetry event measurement/property shapes. |
| go.mod | Adds github.com/mackerelio/go-osstat for system memory metrics. |
| _extension/src/client.ts | Enables telemetry in initialization options (currently hard-coded true). |
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.
This adds events to:
I added an initialization option that toggles telemetry wholesale; the client is already supposed to ignore it if it doesn't care, but best to not enable it when not needed. Of course, as per usual, telemetry is managed by VS Code and can be controlled like any other extension (and it's all just stats anyway). So the toggle is just for efficiency / testing reasons.
The goal of is is so we can gauge how much we are impacting memory usage. I want to start tweaking
GOGCandGOMEMLIMITbut would like to be able to see that it's doing anything.This introduces a new dep in order to get cross-platform memory info in pure Go.