This repository was archived by the owner on Nov 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -84,19 +84,28 @@ export default class ZigTestRunnerProvider {
8484 const matches = Array . from ( textDocument . getText ( ) . matchAll ( regex ) ) ;
8585 this . deleteTestForAFile ( textDocument . uri ) ;
8686
87+ const fileName = path . basename ( textDocument . uri . fsPath ) ;
88+ const fileTestItem = this . testController . createTestItem (
89+ `file:${ textDocument . uri . fsPath } ` ,
90+ fileName ,
91+ textDocument . uri ,
92+ ) ;
93+
8794 for ( const match of matches ) {
8895 const testDesc = match [ 1 ] ;
8996 const position = textDocument . positionAt ( match . index ) ;
9097 const range = new vscode . Range ( position , position . translate ( 0 , match [ 0 ] . length ) ) ;
91- const fileName = path . basename ( textDocument . uri . fsPath ) ;
9298
9399 const testItem = this . testController . createTestItem (
94- `${ fileName } .test.${ testDesc } ` , // Test id needs to be unique, so adding file name prefix
95- ` ${ fileName } - ${ testDesc } ` ,
100+ `${ fileName } .test.${ testDesc } ` ,
101+ testDesc ,
96102 textDocument . uri ,
97103 ) ;
98104 testItem . range = range ;
99- this . testController . items . add ( testItem ) ;
105+ fileTestItem . children . add ( testItem ) ;
106+ }
107+ if ( fileTestItem . children . size > 0 ) {
108+ this . testController . items . add ( fileTestItem ) ;
100109 }
101110 }
102111
You can’t perform that action at this time.
0 commit comments