File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,9 @@ export function sortedWorkspaceFolders(): string[] | undefined {
7777 * @returns outer most workspace folder
7878 */
7979export function getOuterMostWorkspaceFolder (
80- folder : vscode . WorkspaceFolder
81- ) : vscode . WorkspaceFolder {
80+ folder : vscode . WorkspaceFolder | undefined
81+ ) : vscode . WorkspaceFolder | undefined {
82+ if ( folder === undefined ) return undefined ;
8283 const sorted = sortedWorkspaceFolders ( ) ;
8384 for ( const element of sorted ) {
8485 let uri = folder . uri . toString ( ) ;
Original file line number Diff line number Diff line change @@ -51,9 +51,11 @@ suite('Tools tests', () => {
5151 assert . strictEqual ( stderr , 'Errors' ) ;
5252 } ) ;
5353
54- test ( 'Resolve local paths: default workspace' , ( ) => {
55- const absPath = pathRelToAbs ( './sample.f90' ) ;
56- assert . strictEqual ( absPath , path . resolve ( __dirname , '../../test/fortran/sample.f90' ) ) ;
54+ test ( 'Resolve local paths: undefined' , ( ) => {
55+ const root = Uri . parse ( '/home/user/project' ) ;
56+ const absPath = pathRelToAbs ( './sample.f90' , root ) ;
57+ console . log ( absPath , root ) ;
58+ assert . strictEqual ( absPath , undefined ) ;
5759 } ) ;
5860
5961 test ( 'Resolve local paths: workspace selection' , ( ) => {
You can’t perform that action at this time.
0 commit comments