File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,12 @@ let findProjectRootOfFileInDir = (
48
48
// TODO: this doesn't handle file:/// scheme
49
49
export let findProjectRootOfFile = (
50
50
source : p . DocumentUri ,
51
- skipParent ?: boolean
51
+ allowDir ?: boolean
52
52
) : null | p . DocumentUri => {
53
53
// First look in project files
54
54
let foundRootFromProjectFiles : string | null = null ;
55
-
56
55
for ( const rootPath of projectsFiles . keys ( ) ) {
57
- if ( source . startsWith ( rootPath ) && ( ! skipParent || source !== rootPath ) ) {
56
+ if ( source . startsWith ( rootPath ) && ( ! allowDir || source !== rootPath ) ) {
58
57
// Prefer the longest path (most nested)
59
58
if (
60
59
foundRootFromProjectFiles == null ||
@@ -70,7 +69,7 @@ export let findProjectRootOfFile = (
70
69
} else {
71
70
const isDir = path . extname ( source ) === "" ;
72
71
return findProjectRootOfFileInDir (
73
- isDir ? path . join ( source , "dummy.res" ) : source
72
+ isDir && ! allowDir ? path . join ( source , "dummy.res" ) : source
74
73
) ;
75
74
}
76
75
} ;
You can’t perform that action at this time.
0 commit comments