I would like to save files using the command line in VSCODE.
Please add $psise.CurrentFile.SaveAs()
Tagging on to this request, I would also like to be able to get information about VSCode as well. Specifically the version of VSCode.
Just to add a comment.
The SaveAs() method, I believe would be on the Type: Microsoft.PowerShell.EditorServices.Extensions.FileContext
$psEditor.GetEditorContext().currentfile | gm
https://github.com/PowerShell/PowerShellEditorServices/pull/590 we've added .Savewhich will be out this week in 1.6.0. That said, a SaveAs where you pass a string as the name for untitled files might be interesting.
A contributor could look at my PR to add .Save as a base for adding .SaveAs:
https://github.com/PowerShell/PowerShellEditorServices/pull/590
I'll keep this open for that... but this issue should be moved to https://github.com/powershell/powershelleditorservices/
https://github.com/PowerShell/vscode-powershell/pull/1261 adds SaveAs() support. Please give it a try and open a new issue if you have feedback.
This is out the door already :)
The version information is the next thing, although maybe not as high priority. The only tricky part is we will need to define a way for arbitrary editors to provide information about themselves. Very possible, but we should consult maintainers for Atom, Sublime and any other editor front-ends.
@rjmholt is this one merged, however not released?
@brwilkinson Yep, precisely that.
It is possible to grab the most recent build from CI if you'd like it.
Most helpful comment
https://github.com/PowerShell/vscode-powershell/pull/1261 adds
SaveAs()support. Please give it a try and open a new issue if you have feedback.