@@ -47,13 +47,13 @@ export function activate(context: vscode.ExtensionContext) {
4747
4848 resolveDebugConfiguration ( folder : vscode . WorkspaceFolder | undefined , config : vscode . DebugConfiguration , token ?: vscode . CancellationToken ) : vscode . ProviderResult < vscode . DebugConfiguration > {
4949 if ( config && config . type == debuggerType ) {
50- let targetUri : string = utils . getUrlFromConfig ( folder , config ) ;
50+ const targetUri : string = utils . getUrlFromConfig ( folder , config ) ;
5151 if ( config . request && config . request . localeCompare ( 'attach' , 'en' , { sensitivity : 'base' } ) == 0 ) {
5252 attach ( context , /* viaConfig= */ true , targetUri ) ;
53- telemetryReporter . sendTelemetryEvent ( 'launch/command/launch ' ) ;
53+ telemetryReporter . sendTelemetryEvent ( 'launch/command/attach ' ) ;
5454 } else if ( config . request && config . request . localeCompare ( 'launch' , 'en' , { sensitivity : 'base' } ) == 0 ) {
5555 launch ( context , targetUri , config . chromePath ) ;
56- telemetryReporter . sendTelemetryEvent ( 'launch/command/attach ' ) ;
56+ telemetryReporter . sendTelemetryEvent ( 'launch/command/launch ' ) ;
5757 }
5858 } else {
5959 vscode . window . showErrorMessage ( 'No supported launch config was found.' ) ;
@@ -108,26 +108,24 @@ async function attach(context: vscode.ExtensionContext, viaConfig: boolean, targ
108108
109109 responseArray . forEach ( i => {
110110 i = utils . fixRemoteUrl ( hostname , port , i ) ;
111- items . push ( {
112- label : i . title ,
113- description : i . url ,
114- detail : i . webSocketDebuggerUrl
111+ items . push ( {
112+ label : i . title ,
113+ description : i . url ,
114+ detail : i . webSocketDebuggerUrl
115115 } ) ;
116116 } ) ;
117117
118- let targetMatch :boolean = false ;
119- let targetWebsocketUrl :string = '' ;
118+ let targetWebsocketUrl = '' ;
120119 if ( typeof targetUrl === 'string' && targetUrl . length > 0 && targetUrl != defaultUrl ) {
121120 const matches = items . filter ( i => targetUrl . localeCompare ( i . description , 'en' , { sensitivity : 'base' } ) == 0 ) ;
122- if ( matches && matches . length > 0 ) {
121+ if ( matches && matches . length > 0 ) {
123122 targetWebsocketUrl = matches [ 0 ] . detail ;
124- targetMatch = true ;
125123 } else {
126124 vscode . window . showErrorMessage ( `Couldn't attach to ${ targetUrl } .` ) ;
127125 }
128- }
126+ }
129127
130- if ( targetMatch ) {
128+ if ( targetWebsocketUrl && targetWebsocketUrl . length > 0 ) {
131129 DevToolsPanel . createOrShow ( context , targetWebsocketUrl as string ) ;
132130 } else {
133131 vscode . window . showQuickPick ( items ) . then ( ( selection ) => {
0 commit comments