File tree Expand file tree Collapse file tree
platform/environment/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -790,7 +790,7 @@ export class WindowsManager implements IWindowsMainService {
790790 }
791791
792792 // Extract paths: from CLI
793- else if ( openConfig . cli . _ . length > 0 ) {
793+ else if ( openConfig . cli . _ . length > 0 || openConfig . cli [ 'folder-uris' ] ) {
794794 windowsToOpen = this . doExtractPathsFromCLI ( openConfig . cli ) ;
795795 isCommandLineOrAPICall = true ;
796796 }
@@ -847,7 +847,20 @@ export class WindowsManager implements IWindowsMainService {
847847 }
848848
849849 private doExtractPathsFromCLI ( cli : ParsedArgs ) : IPath [ ] {
850- const pathsToOpen = arrays . coalesce ( cli . _ . map ( candidate => this . parsePath ( candidate , { ignoreFileNotFound : true , gotoLineMode : cli . goto } ) ) ) ;
850+ const pathsToOpen = [ ] ;
851+
852+ // folder uris
853+ if ( cli [ 'folder-uris' ] ) {
854+ const arg = cli [ 'folder-uris' ] ;
855+ const folderUris : string [ ] = typeof arg === 'string' ? [ arg ] : arg ;
856+ pathsToOpen . push ( ...arrays . coalesce ( folderUris . map ( candidate => this . parseUri ( URI . parse ( candidate ) , { ignoreFileNotFound : true , gotoLineMode : cli . goto } ) ) ) ) ;
857+ }
858+
859+ // folder or file paths
860+ if ( cli . _ && cli . _ . length ) {
861+ pathsToOpen . push ( ...arrays . coalesce ( cli . _ . map ( candidate => this . parsePath ( candidate , { ignoreFileNotFound : true , gotoLineMode : cli . goto } ) ) ) ) ;
862+ }
863+
851864 if ( pathsToOpen . length > 0 ) {
852865 return pathsToOpen ;
853866 }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
88export interface ParsedArgs {
99 [ arg : string ] : any ;
1010 _ : string [ ] ;
11+ 'folder-uris' ?: string | string [ ] ;
1112 _urls ?: string [ ] ;
1213 help ?: boolean ;
1314 version ?: boolean ;
You can’t perform that action at this time.
0 commit comments