(uri)
| 154 | } |
| 155 | |
| 156 | function findProjectRoot(uri) { |
| 157 | const folders = Array.isArray(globalThis.addedFolder) |
| 158 | ? globalThis.addedFolder |
| 159 | : []; |
| 160 | const target = normalizePath(uri); |
| 161 | let match = null; |
| 162 | let matchLength = -1; |
| 163 | |
| 164 | for (const folder of folders) { |
| 165 | const folderUrl = folder?.url; |
| 166 | if (!folderUrl) continue; |
| 167 | const normalized = normalizePath(folderUrl); |
| 168 | if (!normalized) continue; |
| 169 | if (target === normalized || target.startsWith(`${normalized}/`)) { |
| 170 | if (normalized.length > matchLength) { |
| 171 | match = folderUrl; |
| 172 | matchLength = normalized.length; |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | return match; |
| 178 | } |
| 179 | |
| 180 | function collectCandidateDirectories(fileUri, projectRoot) { |
| 181 | const directories = []; |
no test coverage detected