Commit 945bf8a
committed
fix: add root guard to dirname loops in extension discovery
Add filesystem root detection to two directory-traversal loops in
`src/extension/extension.ts` that hang indefinitely when processing
files at the filesystem root (e.g. `/mermaid.qmd` in Docker containers
with `WORKDIR /`).
`dirname("/")` returns `"/"`, so loops without a root guard never
terminate. Apply the same `nextDir === dir` pattern already used in
`src/project/project-context.ts`.
Closes #142541 parent 64a2120 commit 945bf8a
1 file changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
567 | 569 | | |
568 | 570 | | |
569 | 571 | | |
| |||
878 | 880 | | |
879 | 881 | | |
880 | 882 | | |
881 | | - | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
882 | 889 | | |
883 | 890 | | |
884 | 891 | | |
| |||
0 commit comments