Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout before attempting the save to avoid error message #2

Closed
BillDenton opened this issue Dec 8, 2016 · 7 comments
Closed

Checkout before attempting the save to avoid error message #2

BillDenton opened this issue Dec 8, 2016 · 7 comments

Comments

@BillDenton
Copy link

Is it possible to prevent the error message ("Failed to save 'file': File is write protected ...") by checking out before the save starts. Also, it possible to use a dialog box that is internal to Visual Studio Code, rather than launching the ClearCase dialog box, and use the ClearCase command tools to do the check out.

@OpenNingia
Copy link
Owner

After the user click on "Save" ( or CTRL+S ) VSCode allow to delay saving for as little as 1.5 seconds.

This amount of time is way to little for the user to be able to select the activity from the dialog and confirm; thus the error.

I could programmatically checkout the file with the current activity, but this is not desirable because it is prone to error and does not cover the case when no activity is selected.

@BillDenton
Copy link
Author

There's a format on save option. Is possible to hook into the same place that the "format on save" uses?

@BillDenton
Copy link
Author

I've looked at the API (https://code.visualstudio.com/Docs/extensionAPI/vscode-api) for onWillSaveTextDocument. I see what you mean about the 1.5 seconds. So it appears that the save can't be delayed long enough to allow check out with dialog.

@BillDenton
Copy link
Author

Might have to wait until a proper SCM API is added. See microsoft/vscode#206 and microsoft/vscode#2824

@BillDenton
Copy link
Author

The 1.9 release (insider build at the moment) supports Source Code Management.

@OpenNingia
Copy link
Owner

Did they already release the related documentation? I couldn't find it.
Also I believe this will not really help us as Clearcase is a peculiar SCM; it need to checkout a file before being able to save it while almost every other system don't.

@OpenNingia
Copy link
Owner

I'm closing this one, let's continue this discussion on #10

OpenNingia pushed a commit that referenced this issue May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants