vscode-perforce
vscode-perforce copied to clipboard
Always run p4 commands from within the directory of the target file
I am running into a frequent problem where I have a workspace open in VSCode, but I am editing a file that is outside of that folder. In this scenario, the Perforce plugin fails to check out the file. However if I don't have a workspace open, the plugin uses the directory that the file is in as the CWD, which does work.
My suggestion is to replace this code:
if(checkFolderOpened()) {
edit(fileUri);
} else {
edit(fileUri, Path.dirname(fileUri.fsPath));
}
with this:
edit(fileUri, Path.dirname(fileUri.fsPath));
There are a few places with similar code. If I edit them all the plugin works a lot more reliably. I can't think of any scenario where making the CWD the same as the file's directory would make things worse. What do you think?
@stef-levesque there hasn't been a new release of the vscode python plugin for over a year. Are you planning to continue to develop it? Or are you looking for someone to take over?