microsoft / vscode

Visual Studio Code

Home Page:https://code.visualstudio.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trigger "Save As..." for virtual document editors when saving

Gruntfuggly opened this issue · comments

I'm creating a document using TextDocumentContentProvider. This works well, however I would also like to be able to save the document.

  • the context menu has Save greyed out
  • the File menu allows me to click Save, but does nothing
  • the File menu Save As... does work

I think in all three cases it should simply do the Save As functionality.

I am pushing a change that should enable the flow of "File > Save" (or CtrlCmd+S) to bring up the save dialog even for virtual documents. I hope this does not break any existing flows, so may have to revisit this during the milestone.

Verification: open a readonly document from a virtual document provider (for example stepping into internal source when debugging or F1 > Startup Performance). Verify you can CtrlCmd+S to save the document and a meaningful name is presented. Once you save, verify the file is opened (similar to saving an untitled file).