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: import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { UNTITLED_WORKSPACE_NAME } from 'vs/platform/workspaces/common/workspaces'; import { coalesce } from 'vs/base/common/arrays'; <ins> import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; </ins> // Commands