Skip to content

Commit

Permalink
build: Update telemetry wrapper (#1697)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored Jun 12, 2024
1 parent 25a1871 commit 37cce5c
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 52 deletions.
158 changes: 114 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@
"iconv-lite": "^0.6.3",
"lodash": "^4.17.21",
"lru-cache": "^7.17.0",
"vscode-extension-telemetry-wrapper": "^0.13.3",
"vscode-extension-telemetry-wrapper": "^0.14.0",
"vscode-languageclient": "6.0.0-next.9",
"vscode-tas-client": "^0.1.75"
}
Expand Down
12 changes: 5 additions & 7 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import * as path from 'path';
import { commands, DebugConfiguration, Event, Extension, ExtensionContext, extensions, TestItem, TextDocument, TextDocumentChangeEvent, TextEditor, Uri, window, workspace, WorkspaceFoldersChangeEvent } from 'vscode';
import { addReplacementRule, dispose as disposeTelemetryWrapper, initializeFromJsonFile, instrumentOperation, instrumentOperationAsVsCodeCommand } from 'vscode-extension-telemetry-wrapper';
import { dispose as disposeTelemetryWrapper, initializeFromJsonFile, instrumentOperation, instrumentOperationAsVsCodeCommand } from 'vscode-extension-telemetry-wrapper';
import { navigateToTestOrTarget } from './commands/navigation/navigationCommands';
import { generateTests } from './commands/generationCommands';
import { runTestsFromJavaProjectExplorer } from './commands/projectExplorerCommands';
Expand All @@ -24,8 +24,10 @@ let componentsRegistered: boolean = false;

export async function activate(context: ExtensionContext): Promise<void> {
extensionContext = context;
await initializeFromJsonFile(context.asAbsolutePath('./package.json'), { firstParty: true });
addTelemetryDisallowedPattern();
await initializeFromJsonFile(context.asAbsolutePath('./package.json'), { replacementOptions: [{
lookup: /path must include project and resource name: \/.*/gi,
replacementString: 'Path must include project and resource name: /<REDACT>',
}]});
await initExpService(context);
await instrumentOperation('activation', doActivate)(context);
}
Expand Down Expand Up @@ -169,7 +171,3 @@ export let progressProvider: IProgressProvider | undefined;
function isJavaFile(document: TextDocument): boolean {
return path.extname(document.fileName) === '.java';
}

function addTelemetryDisallowedPattern(): void {
addReplacementRule(/path must include project and resource name: \/.*/gi, 'Path must include project and resource name: /<REDACT>');
}

0 comments on commit 37cce5c

Please sign in to comment.