33
44import * as path from 'path' ;
55import { commands , DebugConfiguration , Event , Extension , ExtensionContext , extensions , TestItem , TextDocument , TextDocumentChangeEvent , TextEditor , Uri , window , workspace , WorkspaceFoldersChangeEvent } from 'vscode' ;
6- import { addReplacementRule , dispose as disposeTelemetryWrapper , initializeFromJsonFile , instrumentOperation , instrumentOperationAsVsCodeCommand } from 'vscode-extension-telemetry-wrapper' ;
6+ import { dispose as disposeTelemetryWrapper , initializeFromJsonFile , instrumentOperation , instrumentOperationAsVsCodeCommand } from 'vscode-extension-telemetry-wrapper' ;
77import { navigateToTestOrTarget } from './commands/navigation/navigationCommands' ;
88import { generateTests } from './commands/generationCommands' ;
99import { runTestsFromJavaProjectExplorer } from './commands/projectExplorerCommands' ;
@@ -24,8 +24,10 @@ let componentsRegistered: boolean = false;
2424
2525export async function activate ( context : ExtensionContext ) : Promise < void > {
2626 extensionContext = context ;
27- await initializeFromJsonFile ( context . asAbsolutePath ( './package.json' ) , { firstParty : true } ) ;
28- addTelemetryDisallowedPattern ( ) ;
27+ await initializeFromJsonFile ( context . asAbsolutePath ( './package.json' ) , { replacementOptions : [ {
28+ lookup : / p a t h m u s t i n c l u d e p r o j e c t a n d r e s o u r c e n a m e : \/ .* / gi,
29+ replacementString : 'Path must include project and resource name: /<REDACT>' ,
30+ } ] } ) ;
2931 await initExpService ( context ) ;
3032 await instrumentOperation ( 'activation' , doActivate ) ( context ) ;
3133}
@@ -169,7 +171,3 @@ export let progressProvider: IProgressProvider | undefined;
169171function isJavaFile ( document : TextDocument ) : boolean {
170172 return path . extname ( document . fileName ) === '.java' ;
171173}
172-
173- function addTelemetryDisallowedPattern ( ) : void {
174- addReplacementRule ( / p a t h m u s t i n c l u d e p r o j e c t a n d r e s o u r c e n a m e : \/ .* / gi, 'Path must include project and resource name: /<REDACT>' ) ;
175- }
0 commit comments