Open RomanNikitenko opened 3 years ago
Theia
supports Workspace Launch configurations.
The configurations should be defined in workspace config file like:
"settings": {
"launch": {
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "pwa-chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
},
At creating the issue I tested another format described in the docs of VS Code: https://code.visualstudio.com/docs/editor/multi-root-workspaces#_workspace-launch-configurations, so like:
"launch": {
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "pwa-chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
],
"compounds": []
},
Please pay attention that for the first case the configuration is placed within settings
object.
The second way (launch
field is outside settings
) doesn't work for Theia
at the moment.
VS Code supports both formats: configs inside and outside settings
. But configurations outside settings
obscure configs insidesettings
- so user should use only one way - either ... either. Please see https://github.com/eclipse-theia/theia/pull/8917#issuecomment-764709137
A few more details: There are two kinds of clobbering going on.
launch
outside of the settings
object overrides launch
inside the settings
object (or they will once #8917 is merged). This is consistent with VSCode behavior.launch.json
then any configurations present in the workspace file will be listed (e.g. in the DebugConfigurationWidget
) for that folder as well. If you add a launch.json
to that folder, then workspace-scoped debug configurations will no longer be listed for that folder. In VSCode, in the analog of the DebugConfigurationWidget
, workspace-scoped debug configurations are always listed separately and never listed as associated with a particular folder.That means that there are two bugs in the current code:
The cause of the first bug is a peculiarity of the way DebugConfigurationManager.parseConfigurations
gets data from PreferenceService.resolve
:
Since .resolve
loops through all scopes and retrieves data, merging the data as it goes, if it picks up a value for launch
from workspace scope and not one from the folder, then it will keep the workspace-scoped value, and the DebugConfigurationModel
for the folder will report it as though the data belonged to it.
The cause of the second bug is that in the DebugConfigurationManager
there is no DebugConfigurationModel
associated with workspace scope.
@colin-grant-work thanks for your investigation and provided details!
Yesterday I created one more issue related to launch configurations: https://github.com/eclipse-theia/theia/issues/8985
I created it as enhancement, I thought the current behavior is the result of the first implementation of launch configs in Theia
without alignment of the behavior with VS Code.
But now for me it looks like a bug and your investigation contains some details related to the cause of the problem.
Feature Description:
VS Code supports adding
launch
configurations to the workspace configuration file.Please see more details here: https://code.visualstudio.com/docs/editor/multi-root-workspaces#_workspace-launch-configurations