Open tom-seddon opened 2 years ago
Actually, it does work if you right click on the file in the Solution Explorer and do P4EditVS
> Checkout
from the context menu.
if you go to Extensions
> P4EditVS
> Checkout
, on the other hand, it checks out just the current file. And that's the command I usually run, as I've got a keyboard shortcut for it.
Feels like it'd be nice to fix this.
OnBeforeQueryStatus
probably needs the same code that's in OnBeforeQueryStatusCtxt
, see // Some files have multiple files such as C# forms have a .cs and .resx files so pick these up here
.
Let me know if you decide to look into fixing it.
I will see if I can fit it in today.
I didn't fit it in today :( - will try to get this done this week.
Looks like ActiveDocument
has a ProjectItem
property, which fingers crossed actually does what you'd expect, so with any luck it can use that info when available.
Got started on this and I realised that the same mechanism is used for all commands, including those which don't really work well with multiple files.
My current thinking is that the addin should sort-of do what you want, which is probably along these lines:
Check out, revert, mark for add, mark for delete Single select: operate on all project items Multi select: operate on all project items Active document: operate on all project items (if any), or document file otherwise
Diff, history, time lapse, graph, p4v Single select: operate on specific file Multi select: disabled, I guess? - seems p4vc only ever opens one window, so a bit pointless. Or maybe just allow it to happen and assume the user can manage Active document: operate on active document file
"Operate on specific file" means like dte.ActiveDocument.FullName or ProjectItem.FileNames[0].
"Operate on all project items" means all the files mentioned in the ProjectItem's FileNames array, and again for the ProjectItem's immediate children. (Or maybe we should do that fully recursively. Dunno.)
I'll get back to this in a day or two.
Got a bit bogged down trying to actually make this change, but it remains on my to-do list. I don't do all that much C#+Perforce stuff generally, but it happens often enough that it won't get forgotten.
If you go to check out something whose kind is
GUID_ItemType_PhysicalFile
, how about if P4EditVS checked out everything in itsProjectItems
array (and recursively)? Looks like that would fix this case.Maybe extend this for folders too? Feels like it'd perhaps end up too easy to check out too much.