4
votes

I'm using VSCode x64 on Win10 x64, and desire to use Perforce with it. I have a Perforce installation on the same machine that already works with both local and remote VS clients. I've installed and loaded the VSCode Perforce plugin from VSCode Marketplace. Activation Mode is set to "autodetect".

However, in the Source Control pane, VSCode shows "SOURCE CONTROL No source control providers registered."

I've found No source control providers registered on Mac and tried the disable-reload sequence described but problem still exists.

No 3-dot menu to "Switch SCM provider". Right now I've disabled all other extensions, Have tried re-installing the extension, as well as adding Perforce login settings to workspace "settings.json", and have put similar ".p4config" at workspace root, but to no avail.

Found Git missing in VSCode - no source control providers, not sure where I would set the equivalent to "git.path" nor what the path would be: to Perforce itself, or to the VSCode extension; not sure of the path to that extension.

Would appreciate any hints on how to get the VSCode Perforce plugin to register. Is the VSCode Perforce plugin known to work with x64 for both VSCode and Win10?

3
Got it. .p4config in the project directory did it. Then open workspace and project folder. Thanks.netboyz
...and I was able to delete the .p4config file by putting overrides for the same info plus a few config items into my user settings file.netboyz
The above answer is correct but keep in mind which version of git you are using. In msys64/mingw under Windows you can't use the msys version of git but you must install the Windows version specifically or it will fail with this problem even if it is on the PATH!WallyZ

3 Answers

5
votes

Following are steps to resolve "No source control providers registered" issue

1) Install GIT

2) Ensure GIT is added to Path environment variable, you can verify whether GIT installation by typing "CTRL+SHFT+P" in VS Code and entering "GIT: Show Git Output". Refer to the screenshot below enter image description here

3) Visual studio code expects that a GIT repository is loaded into it by using open folder. You need to manually clone your GIT repository and load it into Visual studio using "Open Folder" from file menu or side bar enter image description here

4)Now in your Source Control tab, you will find GIT successfully integrated enter image description here

2
votes

I had the same issue. Double check that you have the correct settings enabled:

The following can be set in VSCode user or workspace settings to properly detect the perforce depot

{
    "perforce.user": "your_user",
    "perforce.client": "your_client",
    "perforce.port": "example.com:1666"
}

You can also create a .p4config file at the root of your workspace with perforce variables

P4USER=your_user
P4CLIENT=your_client
P4PORT=example.com:1666

I configured the properties in the workflow settings and set the perforce.activationMode to always and now it works.

Note that only changing the setting parameter perforce.activationMode to always seems not to allow to active the extension if the user/client/port are not correct. I think this may be the root cause for the confusion, as the documentation for this setting reads as it should do so (always - Always try to activate the extension (old behavior)).

PS: Why is none of the other answers referring to Perforce?

-2
votes

The only thing you have to do to solve the problem is open folder appdata folder:

  1. win+r
  2. write %appdata% & ENTER
  3. delete code folder.
  4. Start VS code again

It is restarted. Now you can see the git icon available.