add another 'resolveDebugConfiguration' hook that receives substituted variables #87450
Labels
api-finalization
debug
Debug viewlet, configurations, breakpoints, adapter issues
feature-request
Request for new features or functionality
on-testplan
Milestone
Today variables used in a debug configuration are substituted after the
DebugConfigurationProvider.resolveDebugConfiguration
hook has resolved the debug configuration and before passing it to the debug adapter.This makes it possible to add and modify attributes of the debug configuration by adding more variables to it and still get them substituted in time.
On the other hand this approach makes it difficult to use the resolved variables in the
resolveDebugConfiguration
hook, e.g. for validation or for implementing functionality that solely exists in the extension (and not in the debug adapter where the substituted values are available). See #85206 for an example.From an end users perspective this is confusing: in some (debug configuration) attributes variables can be used (because they are processed in the DA after substitution has occurred), in some attributes variables can not be used (because they are processed in the extension where substitution has not yet occurred). Issue #87450 is a good example for the latter problem.
There are basically two approaches to solve this issue:
DebugConfigurationProvider
into which the debug configuration with substituted values is passed.The first approach sounds simple but is quite complex because variables can be tied to commands which might result in arbitrary user interactions. Or an interactive variable (with UI) is used more than once in a debug configuration. In this case we only want to show the UI once and apply the resulting value in different places. If the extension can use the variable substitution API freely, the UI might pop up multiple times.
To avoid these complications I propose the second (two-phase) approach instead.
API Proposal:
The text was updated successfully, but these errors were encountered: