Perforce integration for Visual Studio Code
add
- Open a new file to add it to the depotedit
- Open an existing file for editrevert
- Discard changes from an opened filediff
- Display diff of client file with depot filediff revision
- Display diff of client file with depot file at a specific revisioninfo
- Display client/server informationlogin
, logout
- Login operationsName | Type | Description |
---|---|---|
perforce.client |
string |
Use the specified client |
perforce.user |
string |
Use the specified user |
perforce.port |
string |
Use the specified protocol:host:port |
perforce.password |
string |
Use the specified password |
perforce.editOnFileSave |
boolean |
Automatically open a file for edit when saved |
perforce.editOnFileModified |
boolean |
Automatically open a file for edit when Modified |
perforce.addOnFileCreate |
boolean |
Automatically Add a file to depot when Created |
perforce.deleteOnFileDelete |
boolean |
Automatically delete a file from depot when deleted |
perforce.dir |
string |
Overrides any PWD setting (current working directory) and replaces it with the specified directory |
perforce.command |
string |
Configure a path to p4 or an alternate command if needed |
perforce.compatibilityMode |
string |
Specify if we should run in compatibility mode, currently support perforce and sourcedepot |
perforce.maxBuffer |
number |
Specify the largest amount of data allowed for commands, including file comparison. Default is 1048576 (1MB) |
perforce.realpath |
boolean |
Experimental Try to resolve real file path before executing command |
perforce.activationMode |
string |
Controls when to activate the extension (always ,autodetect ,off ) |
perforce.countBadge |
string |
Controls the badge counter for Perforce (all ,off ) |
perforce.annotate.enable |
boolean |
Show annotation for every file |
perforce.annotate.changelist |
boolean |
Output changelist numbers rather than revision numbers for each line |
perforce.annotate.user |
boolean |
Output the user who modified the line in the file and the date it was modified |
perforce.changelistOrder |
string |
Specifies the direction of the chnagelist sorting (descending ,ascending ) |
perforce.scmFileChanges |
boolean |
Open file changes when selected in SCM Explorer |
perforce.ignoredChangelistPrefix |
string |
Specifies the prefix of the changelists to be ignored. |
perforce.hideNonWorkspaceFiles |
boolean |
Hide non workspace files in the SCM Explorer. Default changelist only submits files that are opened in current workspace. Warning: If you submit other changelists than the default it will submit files that are not visible. |
perforce.swarmHost |
string |
Specifies the hostname of the Swarm server for annotation links. (https://localhost ) |
perforce.hideShelvedFiles |
boolean |
Hide shelved files in the SCM Explorer. |
perforce.hideEmptyChangelists |
boolean |
Hide changelists with no file in the SCM Explorer. |
perforce.bottleneck |
object |
Experimental Throttle all perforce commands via bottleneck. |
You can specify how you want the extension to activate by setting the parameter perforce.activationMode
always
- Always try to activate the extension (old behavior)autodetect
- Only activate when detecting a valid depot or .p4config
file (default)off
- Don't try to activateThe 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
More detail in Perforce Documentation
You can now specify the following settings per workspace:
perforce.client
perforce.user
perforce.port
perforce.password
perforce.dir
This allows you to work with different repository within the same editor. See Multi-root Workspaces - Settings for more details.
Visual Studio Code now allow to choose which Source Control Manager to use.
Switch SCM Provider
in the command palette, or in the Source Control section menu
Keep in mind this is still in early beta! Explore and leave your comments on GitHub
A: Here are a few steps you should try first:
Perforce: Show Output
A: Increase perforce.maxBuffer
in your user settings.
more...
Source Control
viewletA: Please provide your Perforce Output logs in issue #62
A: Great :) Try to set the experimental setting "perforce.compatibilityMode": "sourcedepot"
more...
ctrl+shift+p
(Windows, Linux) or cmd+shift+p
(OS X)Install Extensions
Perforce for VS Code
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
Visual Studio Code v1.19