Skip to content

Commit 1f7ff27

Browse files
committed
🚑 - Monorepo hotfix
1 parent 0b309d0 commit 1f7ff27

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/src/utils.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,12 @@ let findProjectRootOfFileInDir = (
4848
// TODO: this doesn't handle file:/// scheme
4949
export let findProjectRootOfFile = (
5050
source: p.DocumentUri,
51-
skipParent?: boolean
51+
allowDir?: boolean
5252
): null | p.DocumentUri => {
5353
// First look in project files
5454
let foundRootFromProjectFiles: string | null = null;
55-
5655
for (const rootPath of projectsFiles.keys()) {
57-
if (source.startsWith(rootPath) && (!skipParent || source !== rootPath)) {
56+
if (source.startsWith(rootPath) && (!allowDir || source !== rootPath)) {
5857
// Prefer the longest path (most nested)
5958
if (
6059
foundRootFromProjectFiles == null ||
@@ -70,7 +69,7 @@ export let findProjectRootOfFile = (
7069
} else {
7170
const isDir = path.extname(source) === "";
7271
return findProjectRootOfFileInDir(
73-
isDir ? path.join(source, "dummy.res") : source
72+
isDir && !allowDir ? path.join(source, "dummy.res") : source
7473
);
7574
}
7675
};

0 commit comments

Comments
 (0)