Skip to content

Commit a6a9024

Browse files
authored
Merge pull request #75 from microsoft/joh/semantic-jay
Joh/semantic-jay
2 parents 4639f5f + 3bd7aec commit a6a9024

File tree

10 files changed

+3593
-304
lines changed

10 files changed

+3593
-304
lines changed

anycode/client/package-lock.json

Lines changed: 1281 additions & 80 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

anycode/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"license": "MIT",
44
"publisher": "ms-vscode",
55
"dependencies": {
6-
"@vscode/extension-telemetry": "^0.6.2",
6+
"@vscode/extension-telemetry": "0.8.5",
77
"vscode-languageclient": "^8.0.0-next.5"
88
},
99
"devDependencies": {

anycode/client/src/common/client.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,19 @@ const _statusItem = vscode.languages.createLanguageStatusItem('info', []);
2222
export async function startClient(factory: LanguageClientFactory, context: vscode.ExtensionContext) {
2323

2424
const channel = vscode.window.createOutputChannel('anycode');
25-
const telemetry = new TelemetryReporter(context.extension.id, context.extension.packageJSON['version'], context.extension.packageJSON['aiKey']);
25+
const reporter = new TelemetryReporter(context.extension.packageJSON['aiKey']);
26+
const sender: vscode.TelemetrySender = {
27+
sendEventData(event, data) {
28+
reporter.sendTelemetryEvent(event, data);
29+
},
30+
sendErrorData() {
31+
}
32+
};
33+
const telemetry = vscode.env.createTelemetryLogger(sender);
2634
const supportedLanguages = new SupportedLanguages(channel);
2735

36+
context.subscriptions.push(reporter, telemetry);
37+
2838
let serverHandles: Promise<vscode.Disposable>[] = [];
2939
startServer();
3040

@@ -75,7 +85,7 @@ function _updateStatusAndInfo(selector: vscode.DocumentSelector, showCommandHint
7585
};
7686
}
7787

78-
async function _startServer(factory: LanguageClientFactory, context: vscode.ExtensionContext, supportedLanguagesInfo: SupportedLanguages, telemetry: TelemetryReporter, log: vscode.OutputChannel): Promise<vscode.Disposable> {
88+
async function _startServer(factory: LanguageClientFactory, context: vscode.ExtensionContext, supportedLanguagesInfo: SupportedLanguages, telemetry: vscode.TelemetryLogger, log: vscode.OutputChannel): Promise<vscode.Disposable> {
7989

8090
const supportedLanguages = await supportedLanguagesInfo.getSupportedLanguages();
8191
const documentSelector = await supportedLanguagesInfo.getSupportedLanguagesAsSelector();
@@ -92,7 +102,7 @@ async function _startServer(factory: LanguageClientFactory, context: vscode.Exte
92102
"language" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
93103
}
94104
*/
95-
telemetry.sendTelemetryEvent('feature', { name, language });
105+
telemetry.logUsage('feature', { name, language });
96106
}
97107

98108
const disposables: vscode.Disposable[] = [];
@@ -193,7 +203,7 @@ async function _startServer(factory: LanguageClientFactory, context: vscode.Exte
193203
"duration" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
194204
}
195205
*/
196-
telemetry.sendTelemetryEvent('init', undefined, {
206+
telemetry.logUsage('init', {
197207
numOfFiles: all.length, // number of files found
198208
indexSize: uris.length, // number of files loaded
199209
hasWorkspaceContents, // firehose access?

0 commit comments

Comments
 (0)