New design after talking with @eyalb181 and @aviramha :
When resolving debug configuration, mirrord resolves its own configuration in 3 steps:
Check if active config is set for the workspace. If it is, show the user an info notification (active config feature is meant to be used on an ad hoc basis)
Check if the launch configuration has the config path specified (this is the standard way of using mirrord). Adding a new field to the launch configurations produces an ugly intellisense warning, so the idea is to pass the path as an env variable.
Create a default mirrord config under .mirrord/mirrord.json (if absent) in the workspace folder (we know which one from the resolveDebugConfiguration method arguments) and use it. Show a warning like "hey, I'm using a default config" or "hey, I'm using a config taken from a predefined path". Suggest the user to specify config in the launch configuration.
Some details and considerations:
We have the "change settings" button that needs an update with the new design. I suggest showing a quick pick (same as for selecting target) with options:
Active (path...) (if set by user)
Launch configuration <folder name>:<name> (path...) (one such entry for every launch config in all workspace folders, folder name omitted if there's only one)
Create default in folder <workspace folder> (.mirrord/mirrord.json) (one such entry for every folder)
Passing the config path in the env seems safe. "env" is not a required field for the launch configuration, but most debuggers should use it. Only mandatory names are "name", "type" and "request". So no choice there.
We should enable the user to specify both relative and absolute paths in the env. Relative paths should be resolved in respect to the workspace folder root.
New design after talking with @eyalb181 and @aviramha :
When resolving debug configuration, mirrord resolves its own configuration in 3 steps:
.mirrord/mirrord.json
(if absent) in the workspace folder (we know which one from theresolveDebugConfiguration
method arguments) and use it. Show a warning like "hey, I'm using a default config" or "hey, I'm using a config taken from a predefined path". Suggest the user to specify config in the launch configuration.Some details and considerations:
We have the "change settings" button that needs an update with the new design. I suggest showing a quick pick (same as for selecting target) with options:
Active (path...)
(if set by user)Launch configuration <folder name>:<name> (path...)
(one such entry for every launch config in all workspace folders, folder name omitted if there's only one)Create default in folder <workspace folder> (.mirrord/mirrord.json)
(one such entry for every folder)Passing the config path in the env seems safe. "env" is not a required field for the launch configuration, but most debuggers should use it. Only mandatory names are "name", "type" and "request". So no choice there.
We should enable the user to specify both relative and absolute paths in the env. Relative paths should be resolved in respect to the workspace folder root.