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

Always run p4 commands from within the directory of the target file

Open jan11011977 opened this issue 6 years ago • 1 comments

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?

jan11011977 avatar Jul 20 '18 21:07 jan11011977

@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?

jan11011977 avatar Jan 18 '19 09:01 jan11011977