diff --git a/.changeset/shiny-buckets-remain.md b/.changeset/shiny-buckets-remain.md new file mode 100644 index 0000000000..354f0b4d22 --- /dev/null +++ b/.changeset/shiny-buckets-remain.md @@ -0,0 +1,5 @@ +--- +"vs-code-extension": patch +--- + +adjust path in project tab diff --git a/inlang/source-code/ide-extension/src/utilities/project/project.test.ts b/inlang/source-code/ide-extension/src/utilities/project/project.test.ts index 70eea0370f..47fbe5a469 100644 --- a/inlang/source-code/ide-extension/src/utilities/project/project.test.ts +++ b/inlang/source-code/ide-extension/src/utilities/project/project.test.ts @@ -175,7 +175,7 @@ describe("getTreeItem", () => { const node: ProjectViewNode = { label: "testProject", path: "/path/to/testproject", - relativePath: "./path/to/testproject", + relativePath: "./path/to/testproject.inlang", isSelected: true, collapsibleState: vscode.TreeItemCollapsibleState.Collapsed, context: mockContext, @@ -191,7 +191,7 @@ describe("getTreeItem", () => { workspaceFolder, }) expect(treeItem.label).toBe("testProject") - expect(treeItem.description).toBe("./path/to/testproject") + expect(treeItem.description).toBe("./path/to/testproject.inlang") expect(treeItem.tooltip).toBe("/path/to/testproject") expect(treeItem.iconPath).toBeInstanceOf(vscode.ThemeIcon) }) diff --git a/inlang/source-code/ide-extension/src/utilities/project/project.ts b/inlang/source-code/ide-extension/src/utilities/project/project.ts index c15ee5245d..0befd1b20d 100644 --- a/inlang/source-code/ide-extension/src/utilities/project/project.ts +++ b/inlang/source-code/ide-extension/src/utilities/project/project.ts @@ -45,9 +45,8 @@ export function createProjectViewNodes(args: { const projectPath = typeof project.projectPath === "string" ? project.projectPath : "" const projectName = projectPath.split("/").slice(-1).join("/").replace(".inlang", "") - const cleanedPath = projectPath.replace(/\/[^/]*\.inlang/g, "") const relativePath = - "./" + normalizePath(cleanedPath.replace(args.workspaceFolder.uri.fsPath, "./")) + "./" + normalizePath(projectPath.replace(args.workspaceFolder.uri.fsPath, "./")) return { label: projectName,