* Checks if a URI is within any of the workspace directories * Also verifies the file actually exists, matching the behavior of resolveRelativePathInDir
(ide: IDE, uri: string)
| 17 | * Also verifies the file actually exists, matching the behavior of resolveRelativePathInDir |
| 18 | */ |
| 19 | async function isUriWithinWorkspace(ide: IDE, uri: string): Promise<boolean> { |
| 20 | const workspaceDirs = await ide.getWorkspaceDirs(); |
| 21 | const { foundInDir } = findUriInDirs(uri, workspaceDirs); |
| 22 | |
| 23 | // Check both: within workspace path AND file exists |
| 24 | if (foundInDir !== null) { |
| 25 | return await ide.fileExists(uri); |
| 26 | } |
| 27 | |
| 28 | return false; |
| 29 | } |
| 30 | |
| 31 | export async function resolveInputPath( |
| 32 | ide: IDE, |
no test coverage detected