#10027 confirmSave should check the goal of running an extension is actually…#76337
#10027 confirmSave should check the goal of running an extension is actually…#76337qadram wants to merge 10 commits intomicrosoft:masterfrom qadram:master
Conversation
|
Is that the right issue? It was closed a long time ago |
|
I think it was not correctly closed, as it doesn't solve the problem it was being presented. Problem: When developing an extension and running such extension using the Extension Development Host, dirty files doesn't prompt to save them. If you are developing an extension that needs such prompt, it's not possible because it was disabled on purpose. The logic behind my pull request is:
It's subtle, but it's preventing me from using VS Code to run and debug an extension I'm working on because I cannot test all the scenarios as the prompt is not shown, and I'm not running tests, I'm just developing an extension. Regards |
|
I find the current behaviour work better for this particular use case:
If we would start to prompt for saving changes, we would break this flow. This was one of the main motivations to not ask for saving dirty files initially. |
|
I find that behavior very useful when running tests, like it's noted on the comment, but I find weird that the behavior of the product is modified in such an important way for a code editor. When I noticed my first impression is that such behavior it was a bug, that's why I investigated more and I found, while debugging the code, that it was as designed. In any case, would be great to add a new switch to the command line (or through another mechanism) to allow users to choose the behavior. That is, the existing behavior won't be modified, but if someone wants the Extension Development Host to ask to save dirty files, there should be a mechanism for that. At this moment, there is no alternative. In my case, I'm working on an extension that needs to make dirty several files that are related between them, and when closing one of them, different things should happen. If I don't get the prompt, I cannot verify I'm doing things properly. |
|
By the way, if the suggestion of adding an extra parameter (or any other way) you think it will be OK, I can work on that direction and send another pull request. |
|
Yes, having an extra parameter works for me. I would not show this prominently though (e.g. in the --help output), rather document it on our extension development page. Is that ok? |
|
Sure. Will implement --confirm-save, if present, it will override the existing behavior. |
|
@qadram it needs to have some kind of prefix to make clear it is about extension development right? E.g. |
|
Perfect, thanks! |
…actually to run tests." This reverts commit 9095f2f.
…ting asked to save dirty files when executing an extension
This reverts commit fd9abde.
…ocument is actually closed, not just disposed
|
Continues in #78033 |
… to run tests.