Skip to content

Commit a224178

Browse files
committed
Update documentIndex.ts
1 parent d56ffb2 commit a224178

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/documentIndex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ export function inferDocName(uri: vscode.Uri): string | undefined {
463463
});
464464
if (!containingPaths.size) return; // We couldn't learn anything from the documents in the index
465465
// Sort the values in the Set by number of segments descending so we check the deepest paths first
466-
const containingPathsSorted = Array.from(containingPaths).sort((a, b) => b.split("/").length - a.split("/").length);
466+
const containingPathsSorted = Array.from(containingPaths).sort((a, b) => b.length - a.length);
467467
let result: string;
468468
for (const prefix of containingPathsSorted) {
469469
if (uri.path.startsWith(prefix)) {

0 commit comments

Comments
 (0)