MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / resolveNativeAst

Function resolveNativeAst

src/ast/native-loader.ts:82–102  ·  view source on GitHub ↗
(
  cfg: NativeAstConfig | undefined,
  projectRoot: string
)

Source from the content-addressed store, hash-verified

80 * same diagnostics sink.
81 */
82export function resolveNativeAst(
83 cfg: NativeAstConfig | undefined,
84 projectRoot: string
85): NativeAstResolved {
86 if (!cfg || !cfg.enabled) return DISABLED;
87
88 const cached = resolvedCache.get(cfg);
89 if (cached) return cached;
90
91 const languages = new Set(cfg.languages ?? []);
92 const resolved: NativeAstResolved = {
93 mode: cfg.enabled === "strict" ? "strict" : "on",
94 languages,
95 authoritative: languages.size > 0,
96 pluginDirs: defaultPluginDirs(projectRoot, cfg.pluginDir),
97 diagnostics: [],
98 warnings: [],
99 };
100 resolvedCache.set(cfg, resolved);
101 return resolved;
102}
103
104/** Ordered plugin search path. Explicit override first, then user/data dirs, then install dir. */
105function defaultPluginDirs(projectRoot: string, override?: string): string[] {

Callers 2

scanFunction · 0.85
native-ast.test.tsFile · 0.85

Calls 1

defaultPluginDirsFunction · 0.85

Tested by

no test coverage detected