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 operations
Name | 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. |
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 activate
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
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.
- You can find
Switch SCM Provider
in the command palette, or in the Source Control section menu - Use the input box to create new changelists
- Right-click on file and changelist for more commands
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:
- Look at the logs with
Perforce: Show Output
- Search the existing issue on GitHub
- If you can't find your problem, create an issue, and please include the logs when possible
A: Increase perforce.maxBuffer
in your user settings.
more...
A: Please provide your Perforce Output logs in issue #62
A: Great :) Try to set the experimental setting "perforce.compatibilityMode": "sourcedepot"
more...
- Install Visual Studio Code (1.19 or higher)
- Launch Code
- From the command palette
ctrl+shift+p
(Windows, Linux) orcmd+shift+p
(OS X) - Select
Install Extensions
- Choose the extension
Perforce for VS Code
- Reload Visual Studio Code
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Visual Studio Code v1.19