For me, Automatic Checkout (for Edit) does not work
an-dr-eas-k opened this issue · comments
Hi,
when saving a file, I get the "file is readonly" notification, automatic checkout is not working.
After using "TFS: Checkout file" I can save the file.
I additionally installed the following extension which is successfully checking out before saving:
Name: mde.checkout-tfs
Publisher: fozzeuh
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=mde.checkout-tfs
Help appreciated.
Hi @an-dr-eas-k, Many thanks!
Yes, this function is broken for now. VSCode limits execution time of workspace.onWillSaveTextDocument event handlers. They only have 1.5 seconds to complete. So it's a little bit tricky to implement this feature properly because interaction with a confirmation dialog and tf checkout command both are time consuming things.
I'm trying to implement an optimisic removing of a read-only attribute from a file before the file will be actually checked out from TFS. This approach will help to satisfy VSCode requirements, but with a small probability that the modified file will not be really unlocked at the end.
Automatic Checkout has been removed from the extension because I cannot find a way to support it for the recent versions of VSCode.
You can add a custom key binding for the vscode-tfs.checkout
command and invoke to unlock a file before editing.