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

Editing a file should trigger checkout from Perforce

Open catonyx1 opened this issue 3 years ago • 2 comments

Issue Type: Feature Request

When I attempt to edit a file, a pop up occurs about being read only and some choices to override, reverts, etc. But with the Perforce extension installed it would be better to have a choice to "checkout" the file from version control. It is a bit cumbersome to find the file VSCode explorer, right click, navigate to Perforce and select Edit. This even more cumbersome if you started from the search window. It would be nice to have Perforce "Edit" on a right click for any file that is open (that may be a second feature request).

Extension version: 4.15.2 VS Code version: Code 1.67.2 (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5, 2022-05-17T18:15:52.058Z) OS version: Windows_NT x64 10.0.19044 Restricted Mode: No

catonyx1 avatar Jun 28 '22 15:06 catonyx1

Hi - there is a setting perforce.editOnFileSave which may do what you're looking for (automatically opens a file for edit when you save it)?

Agree - If you don't want the auto open, then an additional context menu on the file itself could be useful! (or it could be useful in general)

There are a couple of existing alternatives vs using the explorer context menu:

  • Click on the 'p4' in the status bar and choose edit
  • There is a command perforce.edit which you can find in the command palette. This opens the current file for edit. It has a default keybinding of alt+p e but you can customise this

mjcrouch avatar Jul 20 '22 19:07 mjcrouch

FWIW, I mapped the command "edit and save" to ⌘E ⌘S, so when I see the "file is read-only" popup after pressing ⌘S, I just press ⌘E ⌘S and I'm done.

emroch avatar Jun 09 '23 22:06 emroch