Skip to content

Commit 8af1257

Browse files
committed
fix: visualization of lazy modules on windows
1 parent dd3b21f commit 8af1257

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/background/states/module-tree.state.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ export class ModuleTreeState extends State {
123123
moduleUriParts[0] = moduleUriParts[0] + '.ts';
124124
}
125125
if (!isAbsolute(moduleUriParts[0])) {
126-
const parentParts = currentPath.split(sep);
126+
const parentParts = currentPath.split('/');
127127
parentParts.pop();
128-
const childParts = moduleUriParts[0].split(sep);
128+
const childParts = moduleUriParts[0].split('/');
129129
let longestMatch = 0;
130+
console.log(moduleUriParts[0], currentPath)
130131
const findLongestPrefix = (a: string[], b: string[], astart: number, bstart: number) => {
131132
const max = Math.min(a.length - astart, b.length - bstart);
132133
let matchLen = 0;
@@ -147,9 +148,10 @@ export class ModuleTreeState extends State {
147148
}
148149
}
149150
}
150-
let parentPath = parentParts.slice(0, parentParts.length - longestMatch).join(sep);
151-
moduleUriParts[0] = normalize(join(parentPath, moduleUriParts[0]));
151+
let parentPath = parentParts.slice(0, parentParts.length - longestMatch).join('/');
152+
moduleUriParts[0] = normalize(join(parentPath, moduleUriParts[0])).split(sep).join('/');
152153
}
154+
console.log(moduleUriParts[0])
153155
return getId({
154156
name: moduleUriParts[1],
155157
filePath: moduleUriParts[0]

0 commit comments

Comments
 (0)