Add setting to modify copy separator#101197
Conversation
This commit adds a new custom setting files.copyPathSeparator which allows the user to select a default separator for the copy absolute and relative commands. fixes issue microsoft#56279
bpasero
left a comment
There was a problem hiding this comment.
My feeling is that ILabelService.getUriLabel should provide an option to enforce a certain separator. Not sure if @isidorn has a request for this already?
And even beyond, do people that want to see slash on Windows only use slash when copying or see it in general throughout the UI?
PS: looks like another place where a path is copied is:
|
@bpasero no, currently there are no feature requests for this - reason being we want consistent separtors and currently there was no special client that wanted to have them different. You can create a new feature request though. |
|
Is something like this what you were thinking? Nice catch, I had missed the search copy action. Good point about the separator throughout the UI. Personally I would want to the option to enforce it throughout. I am unfamiliar with the code but I'm thinking it might be best to apply the preferred separator here when the file label formatter is registered?: vscode/src/vs/workbench/contrib/files/browser/files.contribution.ts Lines 60 to 75 in 85d3eb2 |
|
Let's get some more peoples opinions about the general change: #56279 (comment) Nevertheless, having a way to pass in the separator to the label service seems good, even if we decide to only change it for the copy action. |
|
I pushed some light tweaks on top and made the setting specific for the relative path case, not the absolute one because reading through the issue I came to the conclusion that this behaviour is only wanted for relative paths. Merging for July, thanks! |
This will add a new custom setting
files.copyPathSeparatorwhich will allow the user to select a default separator for the copy absolute and relative commands.fixes issue #56279
I am not sure if this is the best way to do this. Since we want to avoid setting the separator for all labels, an alternative could be to pass a
ResourceLabelFormattingobject intogetUriLabelinstead, but that solution seems clunky.