Code change:
VSCode Version: 1.18.0 / 1.19.0-insider OS Version: Windows 10 Steps to Reproduce: a Project with Workspace (Typescript) one external method inside other method in whatever class. Alt+F12 to open "Peek Definition" the method opened in peek definition .. bug reproduced.. file opened in peek definition now be opened in workspace. Even after save the file on peek definition, the file opened on workspace continue without save. <!-- Launch with to check. --Reproduces without extensions: No
Can you please clairify what the problem is. Here's what I see: ! Is the error that file from the peek definition ( in my gif) still has the unsaved indicator in the workspace, even after you save it?
Yes, even after I save the file (). Pointer with focus inside peek definition, and I press and after to save and close peek definition the file continue with unsaved indicator. This behavior did not happen, even after I change file inside peek definition the file changed would not open.
See my gif. Note that the focus is on the peek definition and when I press the saved file is not , but . I believe this behavior is wrong. !
As designed, we open editors that are dirty to prevent data loss.
But this is nothing intuitive See my image, not would be interesting working like this? When change file, show the little ball in peek definition. ! When click to or , then show the confirmation: !
and what should happen when you close the tab?
In this case if close the would could execute one stack of confirmation of files changed starting by
And if close vscode, then would be open the file on tab with changes before close. Like this no data is lost.
I do not like that behaviour, I prefer that one modified editor maps to one opened tab, anything else makes it very hard for the user to track dirty files.
ok.
I've been in Visual Studio to see how it behaves and actually vscode is behaving the same way it does. However, in visual studio when we save the file in focus inside peek definition the file opened in the tab is saved. I think vscode should behave the same way. In this case, I reiterate that saving the and not file when I am with the cursor in peek definition when pressing is a bug. ! Now, see this behavior on vscode on press !
?
Yeah thats a good one, lets take this issue to reflect that.
has there been any updates on this issue? I think this behaviour is rather reasonable and intuitive, though I'm kinda surprised this issue hasn't seen more activity (I'd expect more people to want this). I had someone ask about this very thing on my extension: and this could really help us:
I've found that adding the following to accomplishes nearly the same thing: Works for me since I don't tend to keep unsaved files open often. Might be useful for CSS Peek.
Hi I agree with guys, that is really annoying, I'm wondering why they still didn't fix this problem ... !!! why Ctrl+S work in peek preview ?!? its fine in Visual Studio
! I pushed a change to enable this by default if the embedded editor is focused. Pressing or will now save both the main editor and the embedded editor. Feedback welcome, it will be in tomorrows insider build:

Related discussion:
text: // Save / Save As / Save All / Revert <del> function saveSelectedEditors(accessor: ServicesAccessor, options?: ISaveEditorsOptions): Promise<void> { </del> <ins> async function saveSelectedEditors(accessor: ServicesAccessor, options?: ISaveEditorsOptions): Promise<void> { </ins> const listService = accessor.get(IListService); const editorGroupsService = accessor.get(IEditorGroupsService); <del> return doSaveEditors(accessor, getMultiSelectedEditors(listService, editorGroupsService), options); </del> <ins> const codeEditorService = accessor.get(ICodeEditorService); const textFileService = accessor.get(ITextFileService); // Save editors const editors = getMultiSelectedEditors(listService, editorGroupsService); await doSaveEditors(accessor, editors, options); // Special treatment for embedded editors: if we detect that focus is // inside an embedded code editor, we save that model as well if we // find it in our text file models. Currently, only textual editors // support embedded editors. const focusedCodeEditor = codeEditorService.getFocusedCodeEditor(); if (focusedCodeEditor instanceof EmbeddedCodeEditorWidget) { const resource = focusedCodeEditor.getModel()?.uri; // Check that the resource of the model was not saved already if (resource && !editors.some(({ editor }) => isEqual(toResource(editor, { supportSideBySide: SideBySideEditor.MASTER }), resource))) { const model = textFileService.models.get(resource); if (!model?.isReadonly()) { await textFileService.save(resource, options); } } } </ins> } function saveDirtyEditorsOfGroups(accessor: ServicesAccessor, groups: ReadonlyArray<IEditorGroup>, options?: ISaveEditorsOptions): Promise<void> {