Skip to content

Commit

Permalink
Merge pull request #2942 from opral/felixhaeberle/sherl-86-rename-pat…
Browse files Browse the repository at this point in the history
…h-in-project-tab

rename path in project tab | Sherlock 🕵️‍♂️
  • Loading branch information
felixhaeberle authored Jun 18, 2024
2 parents 2fa96b3 + da3963a commit 1930355
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-buckets-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vs-code-extension": patch
---

adjust path in project tab
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1930355

Please sign in to comment.