Feature/outer paths for project (#11445)

* allow relative paths in project file outside of project folder

* Adding some tests

* Adding error string to loc strings

* Fixed test

* fix error message

* PR comments and some more fixes
This commit is contained in:
Udeesha Gautam
2020-07-22 19:28:03 -07:00
committed by GitHub
parent efc8182954
commit 196b3752a9
13 changed files with 112 additions and 36 deletions

View File

@@ -380,6 +380,13 @@ export class ProjectsController {
}
private getProjectEntry(project: Project, context: BaseProjectTreeItem): ProjectEntry | undefined {
const root = context.root as ProjectRootTreeItem;
const fileOrFolder = context as FileNode ? context as FileNode : context as FolderNode;
if (root && fileOrFolder) {
// use relative path and not tree paths for files and folder
return project.files.find(x => utils.getPlatformSafeFileEntryPath(x.relativePath) === utils.getPlatformSafeFileEntryPath(utils.trimUri(root.fileSystemUri, fileOrFolder.fileSystemUri)));
}
return project.files.find(x => utils.getPlatformSafeFileEntryPath(x.relativePath) === utils.getPlatformSafeFileEntryPath(utils.trimUri(context.root.uri, context.uri)));
}