vscode: Run menu does not remember dynamic launch configurations
Refs: #95837
Version: 1.45.0-insider (user setup)
Commit: 0778354f3a6a2c21b7f738a5e6b02e2f1c765e73
Date: 2020-04-27T05:42:11.567Z
Electron: 7.2.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363
Steps to Reproduce:
- Select a dynamic launch configuration
- Reload the window
- The dynamic launch configuration is no longer the selected item in the
Runmenu
I assume this is because the dynamic configurations are provided asynchronously/aren’t present when the view is first loaded.
Switching out the selected configuration after extension activation would be awkward. Maybe the run view should have a ‘stub’ item and assume that the previously selected dynamic configuration will be provided once activation completes (and only reset the selected item if it doesn’t exist after activation).
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (14 by maintainers)
Commits related to this issue
- fixes #96293 — committed to msftwindowslinux/vscode by isidorn 4 years ago
@weinand I have verified that the perisisted “noDebug” property is not again occuring. However I tried this with JS Debug which is now using a new
noDebugAPI. So there might be some provider which provides dynamic configurations with the noDebug field for which this might get broken - I did not try them all.Also you are correct that we can not ask the user, that we could just pick the right launch config. I missed this idea in my thought process. However for this we need to store the
typeof the dynamic config provider (so we know which one to ask) and we would have to re-wire a bit how getting dynamic configurations is done (since currently it is coded in a way that it asumes a user would make the choice). So it is a medium size change.Due to the above I will revert the change and push this out to debt week.
As we have agreed I am now:
typeof a used debug configuration. We already stored thenametypeand ask them for dynamic configurations. If they provide a confiuration which has the last usednamewe will automatically select itI have tried this and it works good. Please try it out and let me know how it goes for you.
@isidorn you said:
I don’t understand why there is a need to for asking the user anything after a reload. If the user selects the stub, we would need to activate the (remembered) extension, get all dynamic launch config from it and then run the one that has the same name as the stub. Only if no dynamic config matches the stub we would have to show an error or just show the Quickpick.
Did you make sure that the issues with the persisted “noDebug” property are not again occurring with your fix? If I understand your fix correctly, then you are doing basically the same, but only on a smaller subset of the configs. This makes problems to occur less likely, but it is not a fundamentally different approach.