@@ -18,7 +18,6 @@ import {
1818import { Deferred , createDeferred } from '../../../common/utils/async' ;
1919import { createReaderPipe , generateRandomPipeName } from '../../../common/pipes/namedPipes' ;
2020import { EXTENSION_ROOT_DIR } from '../../../constants' ;
21- import { TestProvider } from '../../types' ;
2221
2322export function fixLogLinesNoTrailing ( content : string ) : string {
2423 const lines = content . split ( / \r ? \n / g) ;
@@ -90,6 +89,7 @@ export async function startRunResultNamedPipe(
9089 if ( cancellationToken ) {
9190 disposables . push (
9291 cancellationToken ?. onCancellationRequested ( ( ) => {
92+ traceLog ( `Test Result named pipe ${ pipeName } cancelled` ) ;
9393 traceLog ( `Test Result named pipe ${ pipeName } cancelled` ) ;
9494 disposable . dispose ( ) ;
9595 } ) ,
@@ -196,6 +196,10 @@ export function populateTestTree(
196196 const testItem = testController . createTestItem ( child . id_ , child . name , Uri . file ( child . path ) ) ;
197197 testItem . tags = [ RunTestTag , DebugTestTag ] ;
198198
199+ let range : Range | undefined ;
200+ if ( child . lineno ) {
201+ range = new Range ( new Position ( Number ( child . lineno ) - 1 , 0 ) , new Position ( Number ( child . lineno ) , 0 ) ) ;
202+ }
199203 let range : Range | undefined ;
200204 if ( child . lineno ) {
201205 range = new Range ( new Position ( Number ( child . lineno ) - 1 , 0 ) , new Position ( Number ( child . lineno ) , 0 ) ) ;
@@ -273,15 +277,10 @@ export function createDiscoveryErrorPayload(
273277 * @param testName The full test name string.
274278 * @returns A tuple where the first item is the parent test name and the second item is the subtest section or `testName` if no subtest section exists.
275279 */
276- export function splitTestNameWithRegex ( testName : string , testProvider : TestProvider ) : [ string , string ] {
280+ export function splitTestNameWithRegex ( testName : string ) : [ string , string ] {
277281 // If a match is found, return the parent test name and the subtest (whichever was captured between parenthesis or square brackets).
278282 // Otherwise, return the entire testName for the parent and entire testName for the subtest.
279- let regex : RegExp ;
280- if ( testProvider === 'pytest' ) {
281- regex = / ^ ( .* ?) \* \* { ( .* ?) } \* \* $ / ;
282- } else {
283- regex = / ^ ( .* ?) ( [ \[ ( ] .* [ \] ) ] ) $ / ;
284- }
283+ const regex = / ^ ( .* ?) ( [ \[ ( ] .* [ \] ) ] ) $ / ;
285284 const match = testName . match ( regex ) ;
286285 if ( match ) {
287286 return [ match [ 1 ] . trim ( ) , match [ 2 ] || match [ 3 ] || testName ] ;
@@ -351,6 +350,7 @@ export async function hasSymlinkParent(currentPath: string): Promise<boolean> {
351350 // Recurse up the directory tree
352351 return await hasSymlinkParent ( parentDirectory ) ;
353352 } catch ( error ) {
353+ traceError ( 'Error checking symlinks:' , error ) ;
354354 traceError ( 'Error checking symlinks:' , error ) ;
355355 return false ;
356356 }
0 commit comments