Skip to content

Conversation

@bpasero
Copy link
Member

@bpasero bpasero commented Oct 24, 2020

This PR fixes #109224

@bpasero bpasero added this to the October 2020 milestone Oct 24, 2020
@bpasero bpasero requested a review from joaomoreno October 24, 2020 10:37
@bpasero bpasero self-assigned this Oct 24, 2020
@joaomoreno
Copy link
Member

@bpasero Changes look good. But should git really be the one processing the path and splitting it? The workbench does a better job at this, namely since it knows which path separator to use. Wouldn't a better fix be at the workbench diff editor level and have it use a good parent dir description if both files share the same parent directory?

@bpasero
Copy link
Member Author

bpasero commented Oct 26, 2020

@joaomoreno I tried that originally actually but then noticed that Git is using query params to add extra metadata to the URIs. So I cannot simply use extUri.equals(uri1, uri2) to find out if both sides are the same file. I could do a hack and just check for uri.path but that is brittle imho.

@bpasero
Copy link
Member Author

bpasero commented Oct 26, 2020

@joaomoreno if you would register a label formatter that gives me the same path for both URIs, then I think we can do it. Aka, the workbench would get the label for both sides and only show it if it is the same

@bpasero
Copy link
Member Author

bpasero commented Oct 26, 2020

If I run the following code

this.labelService.getUriLabel(dirname(resourceDiffInput.leftResource), { relative: true });

on left and right resource I get results that are not so ideal for showing a short path:

  • file on index: /Users/bpasero/Documents/ticino-playground (git)
  • file not yet staged: /Users/bpasero/Documents/ticino-playground (git) (left) and ticino-playground (right)

I think we cannot just drop the (git) suffix because that is useful in other places like quick pick, but for the editor label this will make it hard to come up with something.

@joaomoreno
Copy link
Member

Yeah the (git) is also there so these files look different in views like Problems, which never show scheme.

@bpasero
Copy link
Member Author

bpasero commented Nov 10, 2020

Obsolete.

@bpasero bpasero closed this Nov 10, 2020
@bpasero bpasero deleted the ben/109224 branch November 10, 2020 09:39
@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Diff editor: show path as description

3 participants