Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nice to have: version of ${dirname} that gives the minimum dirname to differentiate matched names #208684

Closed
andreamah opened this issue Mar 25, 2024 · 1 comment
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@andreamah
Copy link
Contributor

Testing #208388

When testing this, I thought that it'd be nice to have a version of ${dirname} that gives the minimum pathname to differentiate from matches. For example,

**/file.json: ${unique_dirname}/${filename}.${extname}

with the following filetree

my-app/
├─ one/
│  ├─ file.json
│  ├─ new_folder/
│  │  ├─ file.json
├─ two/
│  ├─ file.json
│  ├─ new_folder/
│  │  ├─ file.json

If you had one/file.json open only, it would just open as file.json. If you also opened two/file.json, the original file would be one/file.json and the second would be two/file.json.

Finally, if you only had one/new_folder/file.json open with two/new_folder/file.json, you would show those names as I wrote them, as they both share their immediate parent folder name.

@benibenj
Copy link
Contributor

benibenj commented Mar 26, 2024

We already have a similar concept for the description of the label. When you have multiple files with the same name open, we "dedupe" them by adding the shortest differentiating path as description of the label in the tab (and open editors view).
See in this picture ...\tree and ...\titlebar.
image

I like the idea of making the unique directory more visible than it is in the descriptions. However, a few concerns come to mind:

  • Reliance on Workbench/Open Editors State: It's unusual that label names would change based on the open or closed state of editors, moving away from the simpler approach of using file paths. This could make the UI feel less predictable.
  • Dynamic Renaming: The constant renaming as editors open and close could lead to some confusion for users as the editor no longer has the same name as when the user opened it.
  • Broader Application: Extending this renaming beyond open editors to other areas like quick pick could introduce more complexity (scope would no longer be open editors but all files...?) and potential issues.

I'll leave this open for the time, but might close it depending on the feedback from the community

@benibenj benibenj added the feature-request Request for new features or functionality label Mar 26, 2024
@benibenj benibenj added this to the Backlog milestone Mar 26, 2024
@benibenj benibenj closed this as completed Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants