Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking out C# form .cs file doesn't check out .Designer.cs and .resx #29

Open
tom-seddon opened this issue Oct 3, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@tom-seddon
Copy link

If you go to check out something whose kind is GUID_ItemType_PhysicalFile, how about if P4EditVS checked out everything in its ProjectItems 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.

@tom-seddon
Copy link
Author

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.

@SimpsonGSD SimpsonGSD added the bug Something isn't working label Oct 3, 2022
@SimpsonGSD
Copy link
Owner

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.

@tom-seddon
Copy link
Author

I will see if I can fit it in today.

@tom-seddon
Copy link
Author

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.

@tom-seddon
Copy link
Author

tom-seddon commented Oct 6, 2022

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.

@tom-seddon
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants