Hi, I noticed that when I use the swapdiff VS Code extension to swap two sides of a diff generated with PartialDiff, the filenames in the tab name change.
I believe this is because PartialDiff actually saves the filenames as "text/reg1" and "text/reg2" respectively based on this configuration:
It seems like there's an open VS Code issue at the moment to allow access to the editor tab label via API https://github.com/microsoft/vscode/issues/41909 so I think the best approach is to capture the original filename (edit: and the line number too) within the PartialDiff filename, whether it's an actual file or an "untitled" file, and then other extensions such as swapdiff can make use of those original filenames.
Is this something that's possible to implement? I would be interested in taking a crack at it myself too if possible. :)
Hi, I noticed that when I use the swapdiff VS Code extension to swap two sides of a diff generated with PartialDiff, the filenames in the tab name change.
I believe this is because PartialDiff actually saves the filenames as "text/reg1" and "text/reg2" respectively based on this configuration:
https://github.com/ryu1kn/vscode-partial-diff/blob/cda95b9c2032a70a681c56687eeabbe0d620ab68/src/lib/const.ts#L8-L9
Here's a couple of screenshots that illustrate my point:
You can see below that the uri for the first PartialDiff file contains just the "reg1" name.
And the swapdiff extension simply does a swap of the two diffs based on visible editor uris:
https://github.com/shalimski/swapdiff/blob/0a5e83288a9c7ef57b663fb55a0a9b0c18323ccf/src/extension.ts#L22
It seems like there's an open VS Code issue at the moment to allow access to the editor tab label via API https://github.com/microsoft/vscode/issues/41909 so I think the best approach is to capture the original filename (edit: and the line number too) within the PartialDiff filename, whether it's an actual file or an "untitled" file, and then other extensions such as swapdiff can make use of those original filenames.
Is this something that's possible to implement? I would be interested in taking a crack at it myself too if possible. :)