(
searchFrom: string,
opts: { subprojectScan?: boolean } = {},
)
| 279 | * retry path throttles it; the up-walk always runs). |
| 280 | */ |
| 281 | export function resolveServerRoot( |
| 282 | searchFrom: string, |
| 283 | opts: { subprojectScan?: boolean } = {}, |
| 284 | ): ServerRootResolution { |
| 285 | const up = findNearestCodeGraphRoot(searchFrom); |
| 286 | if (up) return { root: up, viaSubScan: false, candidates: [] }; |
| 287 | if (opts.subprojectScan === false) return { root: null, viaSubScan: false, candidates: [] }; |
| 288 | const base = path.resolve(searchFrom); |
| 289 | if (!eligibleForSubprojectScan(base)) return { root: null, viaSubScan: false, candidates: [] }; |
| 290 | const subs = findIndexedSubprojectRoots(base); |
| 291 | if (subs.length === 1) return { root: subs[0]!, viaSubScan: true, candidates: subs }; |
| 292 | return { root: null, viaSubScan: false, candidates: subs }; |
| 293 | } |
| 294 | |
| 295 | /** |
| 296 | * Unicode-aware word-boundary emulation for the keyword lists below. JS's `\b` |
no test coverage detected