MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / rememberProjectPath

Function rememberProjectPath

src/index.ts:258–278  ·  view source on GitHub ↗
(
  rootPath: string,
  source: ProjectDescriptor['source'] = classifyProjectSource(rootPath),
  options: { touch?: boolean } = {}
)

Source from the content-addressed store, hash-verified

256}
257
258function rememberProjectPath(
259 rootPath: string,
260 source: ProjectDescriptor['source'] = classifyProjectSource(rootPath),
261 options: { touch?: boolean } = {}
262): void {
263 const resolvedRootPath = path.resolve(rootPath);
264 const rootKey = normalizeRootKey(resolvedRootPath);
265 const existingSource = projectSourcesByKey.get(rootKey);
266
267 if (
268 !existingSource ||
269 source === 'root' ||
270 (source === 'subdirectory' && existingSource === 'ad_hoc')
271 ) {
272 projectSourcesByKey.set(rootKey, source);
273 }
274
275 if (options.touch !== false) {
276 touchProject(resolvedRootPath);
277 }
278}
279
280function registerDiscoveredProjectPath(
281 rootPath: string,

Callers 8

registerKnownRootFunction · 0.85
buildProjectDescriptorFunction · 0.85
setActiveProjectFunction · 0.85
syncKnownRootsFunction · 0.85
resolveProjectSelectorFunction · 0.85
initProjectFunction · 0.85

Calls 5

classifyProjectSourceFunction · 0.85
normalizeRootKeyFunction · 0.85
touchProjectFunction · 0.85
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected