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 {
77
77
* @returns outer most workspace folder
78
78
*/
79
79
export function getOuterMostWorkspaceFolder (
80
- folder : vscode . WorkspaceFolder
81
- ) : vscode . WorkspaceFolder {
80
+ folder : vscode . WorkspaceFolder | undefined
81
+ ) : vscode . WorkspaceFolder | undefined {
82
+ if ( folder === undefined ) return undefined ;
82
83
const sorted = sortedWorkspaceFolders ( ) ;
83
84
for ( const element of sorted ) {
84
85
let uri = folder . uri . toString ( ) ;
Original file line number Diff line number Diff line change @@ -51,9 +51,11 @@ suite('Tools tests', () => {
51
51
assert . strictEqual ( stderr , 'Errors' ) ;
52
52
} ) ;
53
53
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 ) ;
57
59
} ) ;
58
60
59
61
test ( 'Resolve local paths: workspace selection' , ( ) => {
You can’t perform that action at this time.
0 commit comments