MCPcopy Index your code
hub / github.com/continuedev/continue / resolveRelativePathInDir

Function resolveRelativePathInDir

core/util/ideUtils.ts:14–28  ·  view source on GitHub ↗
(
  path: string,
  ide: IDE,
  dirUriCandidates?: string[],
)

Source from the content-addressed store, hash-verified

12 Only returns fully resolved URI if it exists
13*/
14export async function resolveRelativePathInDir(
15 path: string,
16 ide: IDE,
17 dirUriCandidates?: string[],
18): Promise<string | undefined> {
19 const dirs = dirUriCandidates ?? (await ide.getWorkspaceDirs());
20 for (const dirUri of dirs) {
21 const fullUri = joinPathsToUri(dirUri, path);
22 if (await ide.fileExists(fullUri)) {
23 return fullUri;
24 }
25 }
26
27 return undefined;
28}
29
30/*
31 Same as above but in this case the relative path does not need to exist (e.g. file to be created, etc)

Callers 8

resolveWorkspaceCwdMethod · 0.90
requestFilesFromRepoMapFunction · 0.90
resolveInputPathFunction · 0.90
getUriFromPathFunction · 0.90
getUriFromPathFunction · 0.90
editToolImplFunction · 0.90

Calls 3

joinPathsToUriFunction · 0.90
getWorkspaceDirsMethod · 0.65
fileExistsMethod · 0.65

Tested by

no test coverage detected