Skip to content

Display Tab Indexes in VSCode #209196

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

swordjjjkkk
Copy link

I'd like a setting to decide show tab index.
there are two reasons i need to open this pull request.

1.It's useful for vim extension use <leader>+num to switch tab pages , and this won't disturb regular users, as it is disabled by default.
2.I tried compile an oss version , but the remote-ssh Extension not support oss version.

I look forward to any feedback or suggestions for improvement. Thank you for considering.

@swordjjjkkk
Copy link
Author

@microsoft-github-policy-service agree

Copy link

@moataz2002 moataz2002 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to be merged

@dbaeumer dbaeumer requested review from benibenj and removed request for benibenj April 2, 2024 09:09
@dbaeumer dbaeumer assigned benibenj and unassigned dbaeumer Apr 2, 2024
@benibenj
Copy link
Contributor

benibenj commented Apr 4, 2024

Please create an issue for this feature and link this PR. Make sure to add a detailed description which describes the use case and the problem it solves.

FYI we added custom editor labels in this months release. It allows you change the name of the open editors/tabs. The setting name is workbench.editor.customLabels.patterns. But it won't give you any info on the tab index.

@swordjjjkkk
Copy link
Author

Please create an issue for this feature and link this PR. Make sure to add a detailed description which describes the use case and the problem it solves.

FYI we added custom editor labels in this months release. It allows you change the name of the open editors/tabs. The setting name is workbench.editor.customLabels.patterns. But it won't give you any info on the tab index.

fixes #209533

@bpasero
Copy link
Member

bpasero commented Apr 7, 2024

FYI we added custom editor labels in this months release. It allows you change the name of the open editors/tabs. The setting name is workbench.editor.customLabels.patterns. But it won't give you any info on the tab index.

I like the idea of having a new variable for the tab index for custom editor labels. Maybe one that is group-relative and one that is global?

@ghrejoe
Copy link

ghrejoe commented May 31, 2024

Please create an issue for this feature and link this PR. Make sure to add a detailed description which describes the use case and the problem it solves.

FYI we added custom editor labels in this months release. It allows you change the name of the open editors/tabs. The setting name is workbench.editor.customLabels.patterns. But it won't give you any info on the tab index.

It would be great if we could add it to this setting

@benibenj
Copy link
Contributor

I would disagree with making this part of the workbench.editor.customLabels.patterns setting. Custom Labels have no relation to tabs/editor groups state. I would rather add a new setting workbench.editor.showIndex or something like this. This would just prepend the index of the editor in the group to the tab. I also check if we could make it part of one of the label format settings but I don't think that would work. What do you think @ghrejoe @bpasero?

@microsoft microsoft deleted a comment from moataz2002 May 31, 2024
@microsoft microsoft deleted a comment from moataz2002 May 31, 2024
@microsoft microsoft deleted a comment from moataz2002 May 31, 2024
@microsoft microsoft deleted a comment from moataz2002 May 31, 2024
Copy link
Contributor

@benibenj benibenj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick review. Haven't tested yet. Also there is a merge conflict. But we still need to finish discussing if and how this should exactly work.

@ghrejoe
Copy link

ghrejoe commented May 31, 2024

I would disagree with making this part of the workbench.editor.customLabels.patterns setting. Custom Labels have no relation to tabs/editor groups state. I would rather add a new setting workbench.editor.showIndex or something like this. This would just prepend the index of the editor in the group to the tab. I also check if we could make it part of one of the label format settings but I don't think that would work. What do you think @ghrejoe @bpasero?

I agree with your statement. I used to think that I was worried about adding too many settings and causing redundancy. In fact, what I am more concerned about is being able to correctly switch to the corresponding editor when using the vim plugin through the [tab index] gt command. I hope to use this feature in the next release so that I don't have to look for plugins every once in a while to see if they can be implemented :)

@swordjjjkkk swordjjjkkk requested review from jrieken and mjbvz as code owners June 3, 2024 10:04
@swordjjjkkk swordjjjkkk force-pushed the tabindex branch 4 times, most recently from 84a50a5 to a3e0c91 Compare June 3, 2024 12:38
@swordjjjkkk
Copy link
Author

I have made the code modifications as required, specifically modifying the following:
1.Moved the settings into options.
2.Moved tab refresh to updateOptions.
3.Simplified the code using a ternary operator.
4.Renamed the setting from 'workbench.tabIndex.enabled' to 'workbench.editor.showTabIndex'.
5.Removed some irrelevant code.

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still not 100% sold that this cannot be configured through editor custom labels. We now limit this feature to how the index appears by hardcoding it (using just the number or number + dot) when people maybe want to configure this (see https://github.com/mkitt/tabline.vim where colon is used).

@bpasero bpasero removed request for jrieken and mjbvz June 3, 2024 12:51
@swordjjjkkk swordjjjkkk requested review from bpasero and benibenj June 6, 2024 06:52
2.Moved tab refresh to updateOptions.
3.Simplified the code using a ternary operator.
4.Renamed the setting from 'workbench.tabIndex.enabled' to 'workbench.editor.showTabIndex'.
5.Removed some irrelevant code.
@roachsinai
Copy link

Any updates?

@ghrejoe
Copy link

ghrejoe commented Jun 18, 2024

Excuse me, how is it going now

@swordjjjkkk
Copy link
Author

Excuse me, how is it going now

The code is already finished, and I have also modified it according to the requirements. Then there was no further message, and I don't know what to do next either.

@benibenj
Copy link
Contributor

benibenj commented Jul 11, 2024

@bpasero Custom Labels work solely based on the file path. It's possible that a custom label is rendered for a file which is not opened. In that case no index could be resolved.

Imagine the template ${tabIndex}: ${filename}.${extname}. If we render the custom label for a file which is not open for example in quick open ${tabIndex} could not be resolved to a number, hence we would have to render an empty string for it and so it would display : file.txt which is not wanted.

Also, if custom labels would use editor group information, it would probably strongly impact performance.

I wonder if we could still allow this to be customized without using custom labels. Any ideas?

@benibenj
Copy link
Contributor

benibenj commented Aug 20, 2024

@swordjjjkkk Untitled editors are not getting the index prepended:
image

@vivodi
Copy link

vivodi commented Dec 29, 2024

Is this still relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants