vscode-perforce icon indicating copy to clipboard operation
vscode-perforce copied to clipboard

Display workspace name rather than local folder name

Open ulfwinberg opened this issue 1 year ago • 3 comments

First off, thanks a lot for maintaining this addon! I use it every day.

Is your feature request related to a problem? Please describe. Currently, the source control repositories seems to be named after the local folder name. This creates a problem for us, since we use the same folder name for some of the workspaces, as seen here: image

The "Common" folders reside on different paths, but this is not directly visible. I have noticed that you can hover over to see the full path, but that is not optimal when you need to switch back and fourth between workspaces.

Describe the solution you'd like This could be solved by naming the repositories by the workspace name, instead of the local folder. The workspace name is guaranteed to be unique, since it is enforced by perforce.

Describe alternatives you've considered Another option would be to include the entire path, but that makes the name very long when you have long search paths.

Additional context With my proposed solution, most probably won't notice any difference, since the workspace and local folder names default are identical (when created from p4v).

Thanks in advance!

ulfwinberg avatar Jan 08 '24 13:01 ulfwinberg

Hi - thanks for the suggestion - I'm not 100% sure (as I haven't looked properly at the code in a while) but I don't think we actually specify this name. IIRC it's just something that vs code is doing where you have a multi-folder workspace, and the only part that we have control over is the sub-label where it says "Perforce".

So, probably we could change that "Perforce" label to include some other context as well, assuming it doesn't mess anything else up. As per most of my replies recently I have to say I probably won't get much time to do this, but welcome to submit a pull request if interested.

mjcrouch avatar Jan 08 '24 14:01 mjcrouch

Ok, got it. I've never attempted anything with VS-code extensions, but I'm happy to take a look.

Do you happen to have any quick pointers on which file(s) to look at?

ulfwinberg avatar Jan 08 '24 14:01 ulfwinberg

I think the label is coming in from ScmProvider.ts and the general discovery of p4 clients happens in extension.ts

mjcrouch avatar Jan 08 '24 14:01 mjcrouch