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

Show editor description (directory) when same-named file exist in workspace #209765

Closed
mlntr opened this issue Apr 7, 2024 · 7 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality workbench-tabs VS Code editor tab issues

Comments

@mlntr
Copy link

mlntr commented Apr 7, 2024

Currently the tab label appears when multiple tabs with the same name are actively open in the editor.
However it would be good if the label appears when multiple files with the same name are in the workspace regardless of whether there are others actively open.

I had tried configuring workbench.editor.labelFormat.

Demonstration:

2+ files in workspace: page.ts, a/page.ts

If both are open at same time:
image

Currently: If one is open:
image

Proposed: If one is open:
image

This way it's easier to know which file is which (because files aren't always actively open of course).

@benibenj
Copy link
Contributor

benibenj commented Apr 8, 2024

Have you had a look at the new workbench.editor.customLabels.patterns setting? It allows you to change the label being displayed. You could for exmple add the following entry which could help with your problem:

  • pattern : **, template: ${dirname}/${filename}.${extname} (prepends the folder name to each open file)

You could also only do this for files which are called page.tsx:

  • pattern : **/page.tsx, template: ${dirname}/${filename}.${extname} (prepends the folder name only for page.tsx files)

@benibenj benibenj added the workbench-tabs VS Code editor tab issues label Apr 8, 2024
@mlntr
Copy link
Author

mlntr commented Apr 9, 2024

@benibenj

Yes, I saw that and thought it's interesting.

I think though it's preferable if alternatively it were possible to do it as proposed above as it's more clear/readable (directory section separate on the right), either as an option or as default (because tab management is easier this way than the current way (where label appears only when same-named tabs are actively open), even if some tabs are slightly longer)

@benibenj
Copy link
Contributor

benibenj commented Apr 9, 2024

You mentioned you tried workbench.editor.labelFormat. What's missing with this feature in your case. It sounds to me as workbench.editor.labelFormat: short would be the fix for you

@mlntr
Copy link
Author

mlntr commented Apr 9, 2024

I had tried workbench.editor.labelFormat to see if there was an option for this, but there wasn't.

  • short/medium/long:
    • Label always appears regardless of whether same-named files exist in the workspace
  • default:
    • Label appears if same-named files in the workspace exist AND actively open
  • Proposed (potentially as default behaviour):
    • Label appears if same-named files in the workspace exist (regardless of whether open/closed)
      • e.g. if there are two tabs named page.jsx in workspace, even if only one of the tabs is actively open (or both), it'd show the label

@benibenj benibenj changed the title Enable tab labels regardless of whether other same-named files are open in a workspace Show editor description (directory) when same-named file exist in workspace Apr 9, 2024
@benibenj benibenj added the feature-request Request for new features or functionality label Apr 9, 2024
@vscodenpa vscodenpa added this to the Backlog Candidates milestone Apr 9, 2024
@vscodenpa
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Jun 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 workbench-tabs VS Code editor tab issues
Projects
None yet
Development

No branches or pull requests

3 participants