Multiple tab labels for diff editors#116178
Conversation
|
@bpasero The checks are "expected" now for a long time. Can you check what's causing the problem? |
|
Thanks for the PR, sorry for the late reply. A little bit on the expectation: I will probably not have time to review this until we get to our yearly issue grooming iteration in October. |
|
I see. That is a bit unfortunate because there will probably be more merge conflicts then, but nevertheless, I'll ping you and probably be available for fixing them in October. |
|
I'll close this due to the discussion in #110694 and @bpasero's recent commit which solves the same issue. |
|
@goldst thanks and sorry for not accepting this PR. Nevertheless I will make sure that your contribution appears in our "Thank You" section for our upcoming 1.61 release (similar to https://code.visualstudio.com/updates/v1_60#_thank-you) |
This PR fixes #110694
Diff editors can have a tab label that is too long in some cases. This PR implements the ability for tabs to have multiple labels, each with separate code icons and shortened paths, and makes use of that for diff editors.
The alternative to this would be to just shorten the paths but keeping the current way of labeling. I have implemented that as well. See #110694 and master...goldst:shorten-diff-title-A for details.
Test this by opening two files with the same name but different paths, then ctrl+shift+p -> compare active file with...
Overview of the most important changes from a technical point of view:
getNamesandgetDescriptionstoIEditorInputso editors can have one or multiple labels. Implement these inEditorInputwhere they return the name and description, and override them inDiffEditorInputto return all three labels (left editor, compare arrow, right editor)tabTitleControl.tsgets all names and descriptions and shortens paths even when there are multiple paths in one labellabel.ts(egMultipleResourceLabelsandResourceLabelWidgets) that have mostly the same methods as the ones previously in use, but they are a wrapper for multiple objects of the previous classes. Also added some interfaces/parent classes (egIResourceLabels,IResourceLabelWidgetandResourceLabelGroupBase) to make sure they behave in the same way as the ones used previously.This PR might have some implications that weren't clear to me, that's why I suggest that it should be reviewed thoroughly. I would also like to have a general yes or no for this approach before I/we fix the merge conflicts.