File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/queries-panel Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,26 +62,27 @@ export class QueryDiscovery
6262 const queriesInRoot = this . paths . filter ( ( query ) =>
6363 containsPath ( workspaceFolder . uri . fsPath , query . path ) ,
6464 ) ;
65- if ( queriesInRoot . length > 0 ) {
66- const root = new FileTreeDirectory < string > (
67- workspaceFolder . uri . fsPath ,
68- workspaceFolder . name ,
69- this . env ,
65+ if ( queriesInRoot . length === 0 ) {
66+ continue ;
67+ }
68+ const root = new FileTreeDirectory < string > (
69+ workspaceFolder . uri . fsPath ,
70+ workspaceFolder . name ,
71+ this . env ,
72+ ) ;
73+ for ( const query of queriesInRoot ) {
74+ const dirName = dirname ( normalize ( relative ( root . path , query . path ) ) ) ;
75+ const parentDirectory = root . createDirectory ( dirName ) ;
76+ parentDirectory . addChild (
77+ new FileTreeLeaf < string > (
78+ query . path ,
79+ basename ( query . path ) ,
80+ query . language ,
81+ ) ,
7082 ) ;
71- for ( const query of queriesInRoot ) {
72- const dirName = dirname ( normalize ( relative ( root . path , query . path ) ) ) ;
73- const parentDirectory = root . createDirectory ( dirName ) ;
74- parentDirectory . addChild (
75- new FileTreeLeaf < string > (
76- query . path ,
77- basename ( query . path ) ,
78- query . language ,
79- ) ,
80- ) ;
81- }
82- root . finish ( ) ;
83- roots . push ( root ) ;
8483 }
84+ root . finish ( ) ;
85+ roots . push ( root ) ;
8586 }
8687 return roots ;
8788 }
You can’t perform that action at this time.
0 commit comments