stef-levesque / vscode-perforce Goto Github PK
View Code? Open in Web Editor NEWPerforce basic commands for Visual Studio Code
License: MIT License
Perforce basic commands for Visual Studio Code
License: MIT License
I have linked files in my project folder whose paths are not in perforce depot, so p4 edit command is not effect, please resolve the symlink path to real path by executing commands
The extension keeps denying any request with this error message:
Perforce Log Output
p4.exe info
ERROR:
Error: Command failed: p4.exe print -q -o "C:\Users...\AppData\Local\Temp\tmp-....." "c:\p4......"
c:\p4...... - must create client 'my-computer-name' to access local files.
This is an FYI message - fell free to close....
Hello,
Thanks for creating and extension for VS Code, we have now added an API for VSCode to enable pluggable SCM Providers. This is currently in the 'preview' state and only in the 'insiders' build. Our plan is to move this into 'stable' in our next release (early April 17).
This lays the foundation for rich SCM Extensions to be distributed through the marketplace. These extensions will have access to all of the features our Git support leverages (this itself is now only using the public API).
Our ASK If you are interested in helping create an SCM provider, we want to help you and have created a new repo with all of the required details including - timelines, instructions, sample implementations, ... https://github.com/Microsoft/vscode-SCMBuilders
Head on over there if you want to help to get going or to monitor progress - with any luck in the coming months we should have a set of high quality SCM providers for VS Code.
Sean
VS Code Team Member
Hey,
I am trying to use this integration for perforce which seems very handy!
Unfortunately I can't get it working. At all.
When I try to login to perforce via vscode I get this error message:
Perforce: Command failed: p4 login
However, from the same folder if I open a terminal and type 'p4 login', then enter the same password it succeeds.
Any ideas what is going on here?
Currently the commands do not work properly if there are spaces in the file paths. Please add quotes around the paths that are passed to executed perforce commands.
This has worked in earlier versions, at least in 0.1.8 where the quotes were added to all paths, but the functionality has apparently broken in the refactoring done for the latest 1.0.0 version.
::RFE::
There is no option of setting keyboard shortcuts for going back and forth when using perforce diff in visual studio code.
This enhancement would be very useful, since using mouse to click on top right corner arrows is not practical at all, and all diff tools have this one implemented either via Fx keys or Ctrl+1/2 combo.
I updated to the v1.11.1 and ran npm install and got this:
node ./node_modules/vscode/bin/install
Detected VS Code engine version: ^1.11.1
Found minimal version that qualifies engine range: 1.11.1
Fetching vscode.d.ts from: https://raw.githubusercontent.com/Microsoft/vscode/1.11.1/src/vs/vscode.d.ts
Error installing vscode.d.ts: Error: Request returned status code: 404
Details: 404: Not Found
Pressing the revert icon next to a changelist or file will revert it without asking for a confirmation. This is very dangerous.
It has already happened to me where I misclicked and accidently reverted my entire changelist.
Possibly a conflict with the sublime perforce plugin, but I can seem to get the edit command to work.
I get the following:
p4.exe edit "c:\Users\snarehanger\Documents\Development\project\proj\js\v2\components\elements\MultiFileUploader.jsx"
ERROR:
Path 'c:\Users\snarehanger\Documents\Development\project\proj\js\v2\components\elements\MultiFileUploader.jsx' is not under client's root 'c:\Users\snarehanger\AppData\Roaming\Sublime Text 3\Packages\User'.
Possibly a p4 configuration issue, but any ideas on this?
Currently you don't get any warning when you edit an outdated file. This is sometimes annoying, because one has to merge after editing the file. When getting a warning with a "get latest revision" button one could avoid this.
As solution one could diff current revision against revision on head with p4 fstat -T "headRev" %file
and p4 fstat -T "haveRev" %file
.
with -m max
support and is configurable as option perforce.changes.max
.
(optional) It can be overridden in command palette.
I can only move files to another already existing changelist. It would be great to be able to create a new changelist.
I would like to easily open a file listed in the source control sidebar in a default editing window rather than a diff view.
Could you please add a config option to make this the default behaviour or alternatively open the editor with a modifier key + left click or middle click or something.
Thanks
Right now you have to open a folder to allow the extension to work at all due to it's use of the per workspace configurations. It would be nice to be able to use this extension with random files that I've opened that aren't in a folder I currently have open.
Seems like you could do this in a pretty straightforward way by having a set of global settings that were able to be overridden by the local workspace settings (if set by the user for that workspace).
Should be disabled by default and configurable as too what shows.
There's an error when openning a huge file (740KB, 25000+ lines):
ERROR:
Error: stdout maxBuffer exceeded
p4.exe opened "xxxxxx.cpp"
Hi
i'm using your tool everyday but there is this little thing that I either don't understand or not available.
We typically use new clients and port settings for every project,
So we have files called .p4config that contains:
P4PORT=:
P4CLIENT=
could you tool detect these files and use these settings so when we jump from one project to another
we do not need to start VSCode with new settings?
Otto
Or delay it until commands are invoked.
Right now whenever I create a new vscode window/instance this message pops up.
Morning! Really enjoy using this at the workplace, so thanks for this.
Is there a reason why the p4 sync command hasn't been included? If no reason, happy to dev and pull it in.
Thanks,
Christian
This is a feature request to be able to directly submit the default changelist.
Checked out items are currently added to the default changelist, but there is no immediate way to submit those changes. The workflow required is to:
This feature should allow:
The combination of these three behaviors would allow for very fast iterative development in appropriately equipped environments.
I use vscode for editing files both within a p4 root and external to it. Because I'm lazy I have it configured like this:
// Automatically open a file for edit when saved
"perforce.editOnFileSave": true,
// Automatically open a file for edit when Modified
"perforce.editOnFileModified": true,
// Automatically Add a file to depot when Created
"perforce.addOnFileCreate": true,
// Automatically delete a file from depot when deleted
"perforce.deleteOnFileDelete": true,
which is awesome while under a p4 root, and super-annoying outside of it. Would an option to ignore errors if not under a p4 root be possible?
I experimented with setting those all to false
by default and just overriding in a .vscode/settings.json
file, but I would need to add that all over my projects for that to work since vscode doesn't seem to walk up the directory structure to find settings.
vscode: 1.11.2
vscode-perforce: 2.0.1
Running an operation that creates a large number of files (for example a local build) inside the perforce workspace causes the extension to rapidly refresh the pending changelists. What I think happens is that multiple refreshes are done in parallel and this leads to lots of duplicate changelists that don't disappear when manually refreshing.
In this screenshot, the only changelist that has an opened file is the actual default changelist, all the other ones are "ghosts".
Hey!
It would be really-really useful if we could select a changelist, or set a default changelist where deleted/edited files go
Thank you very much!
But works when selecting diff from the command palette. Thanks, great plugin.
Error output in the perforce window
ERROR:
Error: Command failed: p4.exe print -q -o "C:\Users\MYUSER\AppData\Local\Temp\tmp-RANDOMFILENAME" "c:\local\path\to\my\file#[object Object]"
Invalid revision number '[object Object]'.
Currently vscode-perforce
runs: p4 annotate -qu <file>
Results in invalid option -u
.
Use the latest version of p4v (2017.1) which comes with p4 (2016.2) and it does not have this flag.
Where do you get the p4 2017.1 version?
Is there a way to exclude the -u
so it can work with this version of p4?
I'm using VSCode 1.11.2 with vscode-perforce 2.0.1.
Reproduction case:
This might be intended behavior, but I'd only expect vscode-perforce to mark as deleted the files that I'm explicitly deleting from within VSCode (especially since re-creating those files does not re-add them).
It would be nice to be able to automatically "p4 edit" a file on saving rather than manually running the command.
Should be very easy when a presave event gets added to the api. I'd be happy to add it.
This ia suggestion for when perforce.editOnFileModified is true.
Imagine opening a file that is not yet checked out in a changelist and you start modifying it and afterwards save the changes. The file is now automatically checked out and put in the default changelist.
Now keep doing CTRL+Z in VSCcode until all changes are undone and the document is exactly the same as it was before. The perforce plugin should automatically detect this and also revert/uncheck the file out of the changelist.
So far I have found two major incompatibilities wiith source depot (aka SD, the internal microsoft fork of perforce).
Problem: SD doesn't support login, it simply uses windows authentication, so the login checks always return false and nothing gets executed.
My workaround: I commented out the body of "isLoggedIn" and just return true instead.
Possible Solution: Provide a "skipLogin" config option. When that is true, "isLoggedIn" always returns true.
Problem: SD doesn't support ztags.
My workaround: I've considered rewriting some regexes as a proof of concept fix, but I haven't done it yet.
Possible Solution: Provide a "useZtags" config option that defaults to true and follows current code paths. When false, it can leave off the ztag parameter and I can write some extra parsing functions to get the output into the correct shape to be compatible with the rest of the program (if possible).
I get following error while running any node related command like npm -v
, npm install
, gulp -v
:
path.js:424
var path = (i >= 0) ? arguments[i] : process.cwd();
^
Error: ENOENT: no such file or directory, uv_cwd
at Error (native)
at Object.posix.resolve (path.js:424:50)
at Function.Module._resolveLookupPaths (module.js:263:17)
at Function.Module._resolveFilename (module.js:330:31)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:26:13
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:76:3)
at Module._compile (module.js:413:34)
When addOnFileCreate and deleteOnFileDelete enabled, moving a file through the UI only marks original file for delete, and does not mark for add in new location and throws permission error.
I have multiple perforce clients and would like to be able to select which perforce client a project uses, rather then create a new client. It would be great to have a setting for this, E.G. "perforce.clientName" which I could use to override the clientname.
I tried changing "perforce.command" to "p4.exe -c " but it gives an error because the value of command gets wrapped with double quotes.
To select a client you would pass -c as an argument to p4.exe.
Steps to Reproduce:
Additional information:
The file mentioned above can be checked out using the plugin menu, manually.
_editOnFileModified _ is working as expected.
Thanks for the plugin, it's been really helpful.
Andy.
I'm considering to contribute to the code so I want to understand the code first.
Is there a reason for that?
It seems like it is extra to me because at consumption you do
import {PerforceCommands} from './PerforceCommands'
It is the same if you remove the namespace and import as:
import * as PerforceCommands from './PerforceCommands'
// or better
import { registerCommands } from './PerforceCommands'
export function activate(...) {
registerCommands()
}
Almost every action clears the resource list and does a complete refresh.
Some changes such as moving a file to a new changelist, marking a file for "edit", etc. could be handled by updating the resources data structure without a refresh.
Also, the overall performance seems very slow. A refresh on my machine takes ~20 seconds whereas using refresh in a standalone tool we have takes less than 10.
vscode-perforce: 1.0.0
p4 info
Client root: e:\hwong\p4\
Current directory e:\hwong\somewhere-else\
p4 should not be invoked.
OS: Linux Mint 18.1
vscode: Version 1.11.2
vscode-perforce: 2.0.1
Other extensions: ms-vscode.cpptools, msjsdiag.debugger-for-chrome, dbaeumer.vscode-eslint, eg2.tslint
I have "perforce.editOnFileSave": true and when I make a simple modification (like adding a newline) into a file that is not checked out, it will be checked out into the default changelist as expected. I can see the change I made when I check the diff.
However, vscode still shows a message saying the file is write-protected:
I have node_modules
ignored (of course), but when I update a package, it tries to run p4.exe delete <file in node_modules>
.
With perforce.deleteOnFileDelete
turned on.
I think it would be a good idea to replace the information message with a statusbar message, because it's annoying to always click the appearing message box.
So instead of:
showInformationMessage("blabla")
you could use:
setStatusBarMessage("blabla", 3000) //Statusbar message that disappears after 3 seconds.
Since the 1.0 update the edit command no longer works. The icon also doesn't correctly reflect the file's status any more.
Using p4 edit from the command line still works the same.
This was not an issue in the previous version.
Currently, the only way to see that a changelist has been correctly submitted is by checking the Perforce Logs. It would be useful some kind of visual feedback according to the result of the submit command.
Moreover, a just submitted changelist still appear in the source control panel, even clicking the refresh button. To get rid of that you have to check out a file for editing or reload the whole vscode window.
# workspace
- main
- branches
- branchA
- branchB
vscode is opening the folder main, branchA, or branchB
The changelist would be more functional if it shows only the changes under the opened folder, not the whole workspace.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.