gitnexus 1.6.13-rc.43 → 1.6.13-rc.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -355,6 +355,12 @@ type ParsedImportSyntax =
355
355
  * deferred — `use` does not execute
356
356
  * (`LanguageProvider.importsExecuteWhereWritten`). */
357
357
  readonly runsOnlyWhenCalled?: boolean;
358
+ /**
359
+ * C/C++ `#include <…>` (true) versus `#include "…"`.
360
+ * Angle includes resolve only on header search paths. Quoted includes
361
+ * may still use the including file's directory and the basename index.
362
+ */
363
+ readonly isSystem?: boolean;
358
364
  }
359
365
  /**
360
366
  * Runtime-computed target — the import path is not a static literal at
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/scope-resolution/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAIpD,4FAA4F;AAC5F,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,0DAA0D;AAC1D,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAE3B;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,WAAW,GACX,OAAO,GACP,UAAU,GACV,OAAO,GACP,YAAY,GACZ,QAAQ,CAAC;AAIb,qFAAqF;AACrF,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,MAAM,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AmB,GAAG,IAAI,CAAC;IAC5D,gEAAgE;IAChE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;gFAE4E;IAC5E,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACvD"}
@@ -1,7 +1,5 @@
1
1
  /**
2
- * Walk `repoPath` recursively and return relative paths of all `.h` files.
3
- * Used by `loadResolutionConfig` so the C resolver can resolve `#include`
4
- * targets that live in `.h` files (classified as C++ by language detection
5
- * but importable from `.c` files).
2
+ * Walk `repoPath` and return relative paths of all `.h` files.
3
+ * Search paths stay on the workspace config; this is only the header set.
6
4
  */
7
5
  export declare function scanHeaderFiles(repoPath: string): ReadonlySet<string>;
@@ -1,55 +1,8 @@
1
- import { readdirSync } from 'fs';
2
- import { join, relative } from 'path';
3
- /** C header extensions to scan for in the workspace. */
4
- const HEADER_EXTENSIONS = new Set(['.h']);
1
+ import { C_HEADER_EXTENSIONS, scanCFamilyHeaders } from './resolution-config.js';
5
2
  /**
6
- * Walk `repoPath` recursively and return relative paths of all `.h` files.
7
- * Used by `loadResolutionConfig` so the C resolver can resolve `#include`
8
- * targets that live in `.h` files (classified as C++ by language detection
9
- * but importable from `.c` files).
3
+ * Walk `repoPath` and return relative paths of all `.h` files.
4
+ * Search paths stay on the workspace config; this is only the header set.
10
5
  */
11
6
  export function scanHeaderFiles(repoPath) {
12
- const headers = new Set();
13
- walk(repoPath, repoPath, headers);
14
- return headers;
15
- }
16
- function walk(dir, root, out) {
17
- let entries;
18
- try {
19
- entries = readdirSync(dir, { withFileTypes: true, encoding: 'utf8' });
20
- }
21
- catch {
22
- return; // permission denied, etc.
23
- }
24
- for (const entry of entries) {
25
- const name = entry.name;
26
- const full = join(dir, name);
27
- if (entry.isDirectory()) {
28
- // Skip common non-source directories and build output dirs.
29
- // Build dirs (dist, build, out, target, _build, .next, cmake-build-*)
30
- // may contain generated headers that shadow source headers.
31
- if (name === 'node_modules' ||
32
- name === '.git' ||
33
- name === 'vendor' ||
34
- name === 'dist' ||
35
- name === 'build' ||
36
- name === 'out' ||
37
- name === 'target' ||
38
- name === '_build' ||
39
- name === '.next' ||
40
- name.startsWith('cmake-build')) {
41
- continue;
42
- }
43
- walk(full, root, out);
44
- }
45
- else if (entry.isFile()) {
46
- const ext = name.slice(name.lastIndexOf('.'));
47
- if (HEADER_EXTENSIONS.has(ext)) {
48
- // Normalize to forward slashes for cross-platform consistency.
49
- // path.relative() returns backslash-separated paths on Windows,
50
- // but the scope-resolution pipeline uses forward slashes uniformly.
51
- out.add(relative(root, full).replace(/\\/g, '/'));
52
- }
53
- }
54
- }
7
+ return scanCFamilyHeaders(repoPath, C_HEADER_EXTENSIONS).headers;
55
8
  }
@@ -1,14 +1,61 @@
1
+ import { type CTranslationUnitPaths } from './resolution-config.js';
2
+ /**
3
+ * A workspace file path pre-decomposed for the suffix-match fallback:
4
+ * `original` is returned verbatim (preserving the prior `bestMatch = filePath`
5
+ * contract); `normalized` and `depth` are precomputed so the hot path does no
6
+ * per-element regex/`split`.
7
+ */
8
+ export interface CSuffixCandidate {
9
+ original: string;
10
+ normalized: string;
11
+ depth: number;
12
+ }
13
+ export type CIncludeSuffixIndex = (allFilePaths: ReadonlySet<string>) => Map<string, CSuffixCandidate[]>;
14
+ /**
15
+ * Basename buckets for quoted `#include "…"` suffix fallback.
16
+ *
17
+ * The builder is shared. Each language keeps its own memo: C++ calls
18
+ * `resolveCFamilyImport` with the index it created here, so a C pass and a
19
+ * C++ pass never read each other's map even when handed the same set.
20
+ */
21
+ export declare function createCIncludeSuffixIndex(): CIncludeSuffixIndex;
22
+ /** Optional search roots. Absent means "quoted include, no declared paths". */
23
+ export interface CIncludeLookup {
24
+ /** `#include <…>`. Never suffix-matches the workspace. */
25
+ readonly isSystem?: boolean;
26
+ /** Fallback `-I` / `-isystem` / `/I` and implicit roots. */
27
+ readonly headerSearchPaths?: readonly string[];
28
+ /** Fallback `-iquote`. Quoted includes only. */
29
+ readonly userHeaderSearchPaths?: readonly string[];
30
+ /**
31
+ * Per translation unit. A hit replaces the fallback lists for that file.
32
+ * The map is the one built at config load — lookup does not copy it.
33
+ */
34
+ readonly translationUnits?: ReadonlyMap<string, CTranslationUnitPaths>;
35
+ /** Nearest-ancestor lists for a file with no database entry. */
36
+ readonly directoryScopes?: ReadonlyMap<string, CTranslationUnitPaths>;
37
+ /** Interface include roots from `target_link_libraries`, keyed by source file. */
38
+ readonly cmakeLinkHeaders?: ReadonlyMap<string, readonly string[]>;
39
+ }
1
40
  /**
2
41
  * Resolve a C #include path to a file in the workspace.
3
42
  *
4
- * Strategy:
5
- * 1. Check for a same-directory sibling relative to the including file
6
- * (matches C compiler `#include "…"` relative-lookup semantics).
7
- * 2. Check for an exact match (path as-is in the workspace).
8
- * 3. Fall back to suffix matching against all workspace file paths.
9
- * Tie-breaking: prefer the match with the fewest path components
10
- * (closest to root). On equal depth, break ties lexicographically
11
- * by normalized path to ensure deterministic resolution regardless
12
- * of filesystem iteration order.
43
+ * Quoted `#include "…"` (the default when `lookup` is omitted, which is
44
+ * what the import-target bench and the older unit tests call):
45
+ * 1. Same directory as the including file
46
+ * 2. User search paths, then header search paths
47
+ * 3. Exact path, then the basename bucket
48
+ *
49
+ * Angle `#include <…>` (`lookup.isSystem`): join the target onto each
50
+ * header search path and return that file, or null. A same-named header
51
+ * under `src/` is not a candidate when `src` is not a search path.
13
52
  */
14
- export declare function resolveCImportTarget(targetRaw: string, fromFile: string, allFilePaths: ReadonlySet<string>): string | null;
53
+ export declare function cIncludeLookupFromConfig(config: {
54
+ readonly headerSearchPaths?: readonly string[];
55
+ readonly userHeaderSearchPaths?: readonly string[];
56
+ readonly translationUnits?: ReadonlyMap<string, CTranslationUnitPaths>;
57
+ readonly directoryScopes?: ReadonlyMap<string, CTranslationUnitPaths>;
58
+ readonly cmakeLinkHeaders?: ReadonlyMap<string, readonly string[]>;
59
+ } | undefined, isSystem: boolean): CIncludeLookup;
60
+ export declare function resolveCImportTarget(targetRaw: string, fromFile: string, allFilePaths: ReadonlySet<string>, lookup?: CIncludeLookup): string | null;
61
+ export declare function resolveCFamilyImport(targetRaw: string, fromFile: string, allFilePaths: ReadonlySet<string>, lookup: CIncludeLookup | undefined, suffixIndex: CIncludeSuffixIndex): string | null;
@@ -1,52 +1,64 @@
1
1
  import { dirname, join } from 'path';
2
2
  import { perFileSet } from '../../import-resolvers/per-file-set.js';
3
+ import { collapseRepoPath, nearestScope, normalizeRepoPath, } from './resolution-config.js';
3
4
  /**
4
- * Per-pass memo: workspace paths bucketed by basename (last path segment),
5
- * keyed on the `allFilePaths` set identity.
5
+ * Basename buckets for quoted `#include "…"` suffix fallback.
6
6
  *
7
- * `resolveCImportTarget` is called once per (quoted) C/C++ `#include` with the
8
- * same `allFilePaths` set per pass (the augmented set is itself memoized in
9
- * the C resolver). The old suffix-match fallback scanned ALL workspace paths
10
- * per include — with a per-element `.replace`/`.split` and no early exit
11
- * (the fewest-path-components tie-break forces a full scan) — i.e.
12
- * O(R_suffix × (F+H)). A path can satisfy `endsWith('/'+target)` (or equal
13
- * the target) ONLY IF its basename equals the target's last segment, so we
14
- * pre-bucket by basename once (O(F+H), `normalized`/`depth` precomputed) and
15
- * the fallback inspects a single small bucket → O(F+H) build + ~O(1)/include.
16
- * `WeakMap`-keyed so it is reclaimed with the pass (no cross-pass staleness).
17
- * Shared by C and C++ (`resolveCppImportTarget` delegates here).
7
+ * The builder is shared. Each language keeps its own memo: C++ calls
8
+ * `resolveCFamilyImport` with the index it created here, so a C pass and a
9
+ * C++ pass never read each other's map even when handed the same set.
18
10
  */
19
- const suffixIndex = perFileSet((allFilePaths) => {
20
- const index = new Map();
21
- for (const original of allFilePaths) {
22
- const normalized = original.replace(/\\/g, '/');
23
- const basename = normalized.slice(normalized.lastIndexOf('/') + 1);
24
- let bucket = index.get(basename);
25
- if (bucket === undefined) {
26
- bucket = [];
27
- index.set(basename, bucket);
11
+ export function createCIncludeSuffixIndex() {
12
+ return perFileSet((allFilePaths) => {
13
+ const index = new Map();
14
+ for (const original of allFilePaths) {
15
+ const normalized = original.replace(/\\/g, '/');
16
+ const basename = normalized.slice(normalized.lastIndexOf('/') + 1);
17
+ let bucket = index.get(basename);
18
+ if (bucket === undefined) {
19
+ bucket = [];
20
+ index.set(basename, bucket);
21
+ }
22
+ bucket.push({ original, normalized, depth: normalized.split('/').length });
28
23
  }
29
- bucket.push({ original, normalized, depth: normalized.split('/').length });
30
- }
31
- return index;
32
- });
24
+ return index;
25
+ });
26
+ }
27
+ const cSuffixIndex = createCIncludeSuffixIndex();
33
28
  /**
34
29
  * Resolve a C #include path to a file in the workspace.
35
30
  *
36
- * Strategy:
37
- * 1. Check for a same-directory sibling relative to the including file
38
- * (matches C compiler `#include "…"` relative-lookup semantics).
39
- * 2. Check for an exact match (path as-is in the workspace).
40
- * 3. Fall back to suffix matching against all workspace file paths.
41
- * Tie-breaking: prefer the match with the fewest path components
42
- * (closest to root). On equal depth, break ties lexicographically
43
- * by normalized path to ensure deterministic resolution regardless
44
- * of filesystem iteration order.
31
+ * Quoted `#include "…"` (the default when `lookup` is omitted, which is
32
+ * what the import-target bench and the older unit tests call):
33
+ * 1. Same directory as the including file
34
+ * 2. User search paths, then header search paths
35
+ * 3. Exact path, then the basename bucket
36
+ *
37
+ * Angle `#include <…>` (`lookup.isSystem`): join the target onto each
38
+ * header search path and return that file, or null. A same-named header
39
+ * under `src/` is not a candidate when `src` is not a search path.
45
40
  */
46
- export function resolveCImportTarget(targetRaw, fromFile, allFilePaths) {
41
+ export function cIncludeLookupFromConfig(config, isSystem) {
42
+ return {
43
+ isSystem,
44
+ headerSearchPaths: config?.headerSearchPaths,
45
+ userHeaderSearchPaths: config?.userHeaderSearchPaths,
46
+ translationUnits: config?.translationUnits,
47
+ directoryScopes: config?.directoryScopes,
48
+ cmakeLinkHeaders: config?.cmakeLinkHeaders,
49
+ };
50
+ }
51
+ export function resolveCImportTarget(targetRaw, fromFile, allFilePaths, lookup) {
52
+ return resolveCFamilyImport(targetRaw, fromFile, allFilePaths, lookup, cSuffixIndex);
53
+ }
54
+ export function resolveCFamilyImport(targetRaw, fromFile, allFilePaths, lookup, suffixIndex) {
47
55
  if (!targetRaw)
48
56
  return null;
49
57
  const normalizedTarget = targetRaw.replace(/\\/g, '/');
58
+ const lists = listsFor(lookup, fromFile);
59
+ if (lookup?.isSystem === true) {
60
+ return matchSearchPaths(normalizedTarget, lists.header, allFilePaths);
61
+ }
50
62
  // Same-directory sibling first: mirrors the C compiler's #include "…"
51
63
  // relative-lookup semantics where the directory of the including
52
64
  // file is searched before the include-path list.
@@ -64,6 +76,14 @@ export function resolveCImportTarget(targetRaw, fromFile, allFilePaths) {
64
76
  return siblingAltNorm;
65
77
  }
66
78
  }
79
+ const onUserPath = lists.user.length === 0 ? null : matchSearchPaths(normalizedTarget, lists.user, allFilePaths);
80
+ if (onUserPath !== null)
81
+ return onUserPath;
82
+ const onHeaderPath = lists.header.length === 0
83
+ ? null
84
+ : matchSearchPaths(normalizedTarget, lists.header, allFilePaths);
85
+ if (onHeaderPath !== null)
86
+ return onHeaderPath;
67
87
  // Exact match (path as-is in the workspace)
68
88
  if (allFilePaths.has(normalizedTarget))
69
89
  return normalizedTarget;
@@ -94,3 +114,98 @@ export function resolveCImportTarget(targetRaw, fromFile, allFilePaths) {
94
114
  }
95
115
  return bestMatch;
96
116
  }
117
+ function listsFor(lookup, fromFile) {
118
+ const units = lookup?.translationUnits;
119
+ if (units !== undefined && units.size > 0) {
120
+ const exact = units.get(normalizeRepoPath(fromFile));
121
+ if (exact !== undefined) {
122
+ return withCmakeLinks(lookup, fromFile, {
123
+ header: exact.headerSearchPaths,
124
+ user: exact.userHeaderSearchPaths,
125
+ });
126
+ }
127
+ const near = pathsFromTranslationUnits(units, fromFile);
128
+ if (near !== undefined)
129
+ return withCmakeLinks(lookup, fromFile, near);
130
+ }
131
+ const scopes = lookup?.directoryScopes;
132
+ const paths = scopes !== undefined && scopes.size > 0 ? nearestScope(scopes, fromFile) : undefined;
133
+ if (paths !== undefined) {
134
+ return withCmakeLinks(lookup, fromFile, {
135
+ header: paths.headerSearchPaths,
136
+ user: paths.userHeaderSearchPaths,
137
+ });
138
+ }
139
+ if (units !== undefined && units.size > 0) {
140
+ return withCmakeLinks(lookup, fromFile, { header: [], user: [] });
141
+ }
142
+ return withCmakeLinks(lookup, fromFile, {
143
+ header: lookup?.headerSearchPaths ?? [],
144
+ user: lookup?.userHeaderSearchPaths ?? [],
145
+ });
146
+ }
147
+ function withCmakeLinks(lookup, fromFile, lists) {
148
+ const extra = cmakeLinksFor(lookup?.cmakeLinkHeaders, fromFile);
149
+ if (extra.length === 0)
150
+ return lists;
151
+ return { header: [...new Set([...lists.header, ...extra])], user: lists.user };
152
+ }
153
+ function cmakeLinksFor(links, fromFile) {
154
+ if (links === undefined || links.size === 0)
155
+ return [];
156
+ const file = normalizeRepoPath(fromFile);
157
+ const exact = links.get(file);
158
+ if (exact !== undefined)
159
+ return exact;
160
+ const dir = directoryOf(file);
161
+ const header = [];
162
+ for (const [source, paths] of links) {
163
+ if (directoryOf(source) !== dir)
164
+ continue;
165
+ header.push(...paths);
166
+ }
167
+ return [...new Set(header)];
168
+ }
169
+ /**
170
+ * The database lists source files, not the headers they include. A header
171
+ * uses the `-I` / `-iquote` lists of a translation unit in the same directory.
172
+ * A file in another directory does not inherit that list.
173
+ */
174
+ function pathsFromTranslationUnits(units, fromFile) {
175
+ const file = normalizeRepoPath(fromFile);
176
+ const dir = directoryOf(file);
177
+ const header = [];
178
+ const user = [];
179
+ let found = false;
180
+ for (const [unitFile, paths] of units) {
181
+ if (directoryOf(unitFile) !== dir)
182
+ continue;
183
+ found = true;
184
+ header.push(...paths.headerSearchPaths);
185
+ user.push(...paths.userHeaderSearchPaths);
186
+ }
187
+ if (!found)
188
+ return undefined;
189
+ return { header: [...new Set(header)], user: [...new Set(user)] };
190
+ }
191
+ function directoryOf(file) {
192
+ const normalized = normalizeRepoPath(file);
193
+ const slash = normalized.lastIndexOf('/');
194
+ return slash === -1 ? '' : normalized.slice(0, slash);
195
+ }
196
+ function matchSearchPaths(normalizedTarget, roots, allFilePaths) {
197
+ if (roots.length === 0 || normalizedTarget.length === 0)
198
+ return null;
199
+ for (const root of roots) {
200
+ const candidate = joinSearch(root, normalizedTarget);
201
+ if (candidate !== undefined && candidate.length > 0 && allFilePaths.has(candidate)) {
202
+ return candidate;
203
+ }
204
+ }
205
+ return null;
206
+ }
207
+ function joinSearch(root, target) {
208
+ if (root.length === 0 || root === '.')
209
+ return collapseRepoPath(target);
210
+ return collapseRepoPath(`${root}/${target}`);
211
+ }
@@ -6,10 +6,11 @@ export function interpretCImport(captures) {
6
6
  const source = captures['@import.source']?.text;
7
7
  if (source === undefined)
8
8
  return null;
9
- // System headers (e.g. <stdio.h>) are not resolved to local files
10
- if (captures['@import.system'] !== undefined)
11
- return null;
12
- return { kind: 'wildcard', targetRaw: source };
9
+ return {
10
+ kind: 'wildcard',
11
+ targetRaw: source,
12
+ isSystem: captures['@import.system'] !== undefined,
13
+ };
13
14
  }
14
15
  /**
15
16
  * Interpret a C type-binding capture into a ParsedTypeBinding.
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Per-workspace C/C++ include config — the analog of Objective-C's header
3
+ * scan plus the project files clangd already reads.
4
+ *
5
+ * Loaded once per analyze pass and threaded into `resolveCImportTarget`.
6
+ * `#include <stdio.h>` joins the target onto `headerSearchPaths` and never
7
+ * suffix-matches a same-named file under `src/`. `#include "util.h"` may
8
+ * still look next to the importer and in the basename index.
9
+ *
10
+ * Config is read in every directory, not only the root, and a file takes
11
+ * the nearest one — how clangd finds `compile_commands.json` and
12
+ * `compile_flags.txt` in a monorepo. CMake `include_directories` and
13
+ * `target_include_directories` are read too. Make, Meson, and Bazel are not
14
+ * parsed; `compile_commands.json` is the compilation database they emit.
15
+ */
16
+ export declare const C_HEADER_EXTENSIONS: ReadonlySet<string>;
17
+ export declare const CPP_HEADER_EXTENSIONS: ReadonlySet<string>;
18
+ /** Include roots for one translation unit, or for files with no database entry. */
19
+ export interface CTranslationUnitPaths {
20
+ /** `-I` / `-isystem` / `/I`. Implicit `include` / `Headers` / `inc` only when nothing is declared. */
21
+ readonly headerSearchPaths: readonly string[];
22
+ /** `-iquote`. Quoted includes only. */
23
+ readonly userHeaderSearchPaths: readonly string[];
24
+ }
25
+ export interface CFamilyResolutionConfig {
26
+ /** In-repo headers the scan found. Build trees are not included. */
27
+ readonly headers: ReadonlySet<string>;
28
+ /**
29
+ * Roots for a file that has no `compile_commands.json` entry.
30
+ * Another translation unit's `-I` list is not copied here.
31
+ */
32
+ readonly headerSearchPaths: readonly string[];
33
+ /** `-iquote` roots for a file that has no compilation-database entry. */
34
+ readonly userHeaderSearchPaths: readonly string[];
35
+ /**
36
+ * Per source file, keyed by repo-relative path. Built once per pass.
37
+ * Lookup is a map read; the lists are not rebuilt per include.
38
+ */
39
+ readonly translationUnits: ReadonlyMap<string, CTranslationUnitPaths>;
40
+ /**
41
+ * Roots for a file with no database entry below the repo root, keyed by the
42
+ * directory whose config (or CMakeLists.txt) set them. A file takes its
43
+ * nearest ancestor's entry, else the top-level lists.
44
+ */
45
+ readonly directoryScopes: ReadonlyMap<string, CTranslationUnitPaths>;
46
+ /**
47
+ * Interface include roots a source file sees because its CMake target
48
+ * links another target. Keyed by repo-relative source path.
49
+ */
50
+ readonly cmakeLinkHeaders?: ReadonlyMap<string, readonly string[]>;
51
+ }
52
+ export declare function coerceCFamilyResolutionConfig(value: unknown): CFamilyResolutionConfig | undefined;
53
+ /**
54
+ * The file set a resolver should hand to the include lookup.
55
+ *
56
+ * `augment` is the language's own per-pass memo (`augmentedFilePathsFor`).
57
+ * When there is nothing to union, `allFilePaths` is returned as the same
58
+ * object — a copy would be a new memo key on every include.
59
+ */
60
+ export declare function cFamilyImportFiles(allFilePaths: ReadonlySet<string>, resolutionConfig: unknown, augment: (headers: ReadonlySet<string>) => ReadonlySet<string>): {
61
+ readonly files: ReadonlySet<string>;
62
+ readonly config: CFamilyResolutionConfig | undefined;
63
+ };
64
+ export declare function scanCFamilyHeaders(repoPath: string, headerExtensions: ReadonlySet<string>): {
65
+ readonly headers: ReadonlySet<string>;
66
+ readonly implicitRoots: readonly string[];
67
+ readonly configDirectories: readonly string[];
68
+ };
69
+ export declare function loadCFamilyResolutionConfig(repoPath: string, headerExtensions: ReadonlySet<string>): CFamilyResolutionConfig;
70
+ /** The scope of the deepest directory at or above `path`'s directory. */
71
+ export declare function nearestScope<T>(scopes: ReadonlyMap<string, T>, path: string): T | undefined;
72
+ export declare function normalizeRepoPath(value: string): string;
73
+ /** Collapse `.` / `..` in a repo-relative path. `..` past the root is a miss, not a clipped path. */
74
+ export declare function collapseRepoPath(value: string): string | undefined;