Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/activation/activationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export class LanguageServerExtensionActivationService
outputLine = LanguageService.startingNone();
break;
default:
throw new Error('Unknown langauge server type in activator.');
throw new Error('Unknown language server type in activator.');
}
this.output.appendLine(outputLine);
}
Expand Down
28 changes: 7 additions & 21 deletions src/client/activation/jedi/languageServerProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import {

import { DeprecatePythonPath } from '../../common/experiments/groups';
import { traceDecorators, traceError } from '../../common/logger';
import { IConfigurationService, IExperimentsManager, IInterpreterPathService, Resource } from '../../common/types';
import { IExperimentsManager, IInterpreterPathService, Resource } from '../../common/types';
import { createDeferred, Deferred, sleep } from '../../common/utils/async';
import { swallowExceptions } from '../../common/utils/decorators';
import { noop } from '../../common/utils/misc';
import { LanguageServerSymbolProvider } from '../../providers/symbolProvider';
import { PythonEnvironment } from '../../pythonEnvironments/info';
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
import { captureTelemetry } from '../../telemetry';
import { EventName } from '../../telemetry/constants';
import { ITestManagementService } from '../../testing/types';
import { FileBasedCancellationStrategy } from '../common/cancellationUtils';
Expand All @@ -44,7 +44,6 @@ export class JediLanguageServerProxy implements ILanguageServerProxy {
constructor(
@inject(ILanguageClientFactory) private readonly factory: ILanguageClientFactory,
@inject(ITestManagementService) private readonly testManager: ITestManagementService,
@inject(IConfigurationService) private readonly configurationService: IConfigurationService,
@inject(IExperimentsManager) private readonly experiments: IExperimentsManager,
@inject(IInterpreterPathService) private readonly interpreterPathService: IInterpreterPathService,
) {
Expand Down Expand Up @@ -81,7 +80,7 @@ export class JediLanguageServerProxy implements ILanguageServerProxy {

@traceDecorators.error('Failed to start language server')
@captureTelemetry(
EventName.LANGUAGE_SERVER_ENABLED,
EventName.JEDI_LANGUAGE_SERVER_ENABLED,
undefined,
true,
undefined,
Expand All @@ -107,7 +106,7 @@ export class JediLanguageServerProxy implements ILanguageServerProxy {
// late the server may have already sent a message (which leads to failures). Register
// these on the state change to running to ensure they are ready soon enough.
if (e.newState === State.Running) {
this.registerHandlers(resource);
this.registerHandlers();
}
});

Expand All @@ -131,7 +130,7 @@ export class JediLanguageServerProxy implements ILanguageServerProxy {
}

@captureTelemetry(
EventName.LANGUAGE_SERVER_READY,
EventName.JEDI_LANGUAGE_SERVER_READY,
undefined,
true,
undefined,
Expand All @@ -155,7 +154,7 @@ export class JediLanguageServerProxy implements ILanguageServerProxy {
await this.testManager.activate(new LanguageServerSymbolProvider(this.languageClient));
}

private registerHandlers(resource: Resource) {
private registerHandlers() {
if (this.disposed) {
// Check if it got disposed in the interim.
return;
Expand All @@ -167,7 +166,7 @@ export class JediLanguageServerProxy implements ILanguageServerProxy {
if (this.experiments.inExperiment(DeprecatePythonPath.experiment)) {
this.disposables.push(
this.interpreterPathService.onDidChange(() => {
// Manually send didChangeConfiguration in order to get the server to requery
// Manually send didChangeConfiguration in order to get the server to re-query
// the workspace configurations (to then pick up pythonPath set in the middleware).
// This is needed as interpreter changes via the interpreter path service happen
// outside of VS Code's settings (which would mean VS Code sends the config updates itself).
Expand All @@ -177,18 +176,5 @@ export class JediLanguageServerProxy implements ILanguageServerProxy {
}),
);
}

const settings = this.configurationService.getSettings(resource);
if (settings.downloadLanguageServer) {
this.languageClient!.onTelemetry((telemetryEvent) => {
const eventName = telemetryEvent.EventName || EventName.LANGUAGE_SERVER_TELEMETRY;
const formattedProperties = {
...telemetryEvent.Properties,
// Replace all slashes in the method name so it doesn't get scrubbed by vscode-extension-telemetry.
method: telemetryEvent.Properties.method?.replace(/\//g, '.'),
};
sendTelemetryEvent(eventName, telemetryEvent.Measurements, formattedProperties);
});
}
}
}
2 changes: 1 addition & 1 deletion src/client/activation/jedi/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class JediLanguageServerManager implements ILanguageServerManager {
}

@captureTelemetry(
EventName.LANGUAGE_SERVER_STARTUP,
EventName.JEDI_LANGUAGE_SERVER_STARTUP,
undefined,
true,
undefined,
Expand Down
5 changes: 5 additions & 0 deletions src/client/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ export enum EventName {
HASHED_PACKAGE_PERF = 'HASHED_PACKAGE_PERF',

JEDI_MEMORY = 'JEDI_MEMORY',
JEDI_LANGUAGE_SERVER_ENABLED = 'JEDI_LANGUAGE_SERVER.ENABLED',
JEDI_LANGUAGE_SERVER_STARTUP = 'JEDI_LANGUAGE_SERVER.STARTUP',
JEDI_LANGUAGE_SERVER_READY = 'JEDI_LANGUAGE_SERVER.READY',
JEDI_LANGUAGE_SERVER_TELEMETRY = 'JEDI_LANGUAGE_SERVER.EVENT',
JEDI_LANGUAGE_SERVER_REQUEST = 'JEDI_LANGUAGE_SERVER.REQUEST',

TENSORBOARD_SESSION_LAUNCH = 'TENSORBOARD.SESSION_LAUNCH',
TENSORBOARD_SESSION_DURATION = 'TENSORBOARD.SESSION_DURATION',
Expand Down
26 changes: 26 additions & 0 deletions src/client/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,32 @@ export interface IEventNamePropertyMapping {
*/
userAction: string;
};
/**
* Telemetry event sent when Jedi Language Server is started for workspace (workspace folder in case of multi-root)
*/
[EventName.JEDI_LANGUAGE_SERVER_ENABLED]: {
lsVersion?: string;
};
/**
* Telemetry event sent when Jedi Language Server server is ready to receive messages
*/
[EventName.JEDI_LANGUAGE_SERVER_READY]: {
lsVersion?: string;
};
/**
* Telemetry event sent when starting Node.js server
*/
[EventName.JEDI_LANGUAGE_SERVER_STARTUP]: {
lsVersion?: string;
};
/**
* Telemetry sent from Node.js server (details of telemetry sent can be provided by LS team)
*/
[EventName.JEDI_LANGUAGE_SERVER_TELEMETRY]: unknown;
/**
* Telemetry sent when the client makes a request to the Node.js server
*/
[EventName.JEDI_LANGUAGE_SERVER_REQUEST]: unknown;
/**
* Telemetry captured for enabling reload.
*/
Expand Down