-
Notifications
You must be signed in to change notification settings - Fork 234
Add Save() and IsSaved/IsModified to FileContext API #258
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
Comments
Here is the current Invoke-TaskFromVSCode.ps1. For now it requires a user to save the current build script manually before invoking a task. It would be very useful to make this saving automatic. |
Hey Roman, I can definitely add a 'Save' function and I believe I should be able to add an 'IsModified' field to show whether the file hasn't yet been saved. I will try to get this in for the 0.7.0 release which should be out in the second half of July once I'm back from vacation. |
When can we expect this little, useful, and long awaited piece of API? |
In the next feature update! $psEditor coverage is the short term priority now. |
This little feature would be very useful. Is it still on the radars? I would use it right away for |
@nightroman it's on my radar now 😃 I'll look into this. |
@daviwil + @rkeithhill: It looks like |
Ah. |
I have half of this in a PR so far: I need to think about the IsModified method a bit more. |
@tylerl0706 Thank you!
If |
From a PSES perspective, it doesn't actually save to disk at all. It simply sends the "editor/saveFile" event to the editor - in our case, vscode. VSCode then handles the saving using the extensions API. I can add an additional check to see if the file is dirty before it actually calls the VSCode save function. Would that do what you need in the short term? I'm still thinking on |
Yes, this will do the trick in the short term. |
I see it working great in 1.6.0. Thank you so much! |
Release 0.7.1
Is there any method to save a file opened in the editor? Ideally, to save if it
is modified. If there is a way to check the modified state then I am just
looking for a way to save.
The context. I am working on
Invoke-TaskFromVSCode
, similar toInvoke-TaskFromISE
.The script with tasks should be saved before invoking the current task from it.
In ISE it looks like
The text was updated successfully, but these errors were encountered: