resolveServerRoot before the sensitive-folder refusal.
(searchFrom: string, opts: { subprojectScan?: boolean })
| 514 | |
| 515 | /** {@link resolveServerRoot} before the sensitive-folder refusal. */ |
| 516 | function findServerRoot(searchFrom: string, opts: { subprojectScan?: boolean }): ServerRootResolution { |
| 517 | const none: ServerRootResolution = { root: null, viaSubScan: false, candidates: [], refusal: null }; |
| 518 | const up = findNearestCodeGraphRoot(searchFrom); |
| 519 | if (up) return { root: up, viaSubScan: false, candidates: [], refusal: null }; |
| 520 | if (opts.subprojectScan === false) return none; |
| 521 | const base = path.resolve(searchFrom); |
| 522 | if (!eligibleForSubprojectScan(base)) return none; |
| 523 | const subs = findIndexedSubprojectRoots(base); |
| 524 | if (subs.length === 1) return { root: subs[0]!, viaSubScan: true, candidates: subs, refusal: null }; |
| 525 | return { ...none, candidates: subs }; |
| 526 | } |
| 527 | |
| 528 | /** |
| 529 | * Unicode-aware word-boundary emulation for the keyword lists below. JS's `\b` |
no test coverage detected