-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve command variables contributed by debuggers #11170
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that the change allows to resolve command variables 👍
- Variables such as
${command:PickProcess}
are resolved correctly- Selecting such a debug config opens the quick input to select a process id
- Afterwards, the debugger runs as expected
- Other debug configs continue to work as expected
I have some discussions on the code that I'd like to see resolved before approving.
packages/variable-resolver/src/browser/common-variable-contribution.ts
Outdated
Show resolved
Hide resolved
packages/variable-resolver/src/browser/variable-resolver-service.ts
Outdated
Show resolved
Hide resolved
2b7096d
to
a721460
Compare
@msujew, please take a look to the recent updates which address your remarks, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The debuggers contribution point provides the possibility to specify command id variables which can therefore be referenced within debug configurations. This change reads these contributed variables and feeds them to the variable resolver so they can be used just before resolving values via commands. See "variables" at: https://code.visualstudio.com/api/references/contribution-points#contributes.debuggers In addition, the 'VariableResolverOptions' includes an option to indicate if all variables were successfully resolved, this enables to stop the processing and prevent the possibility of error notifications e.g. in case a user did not select a valid option. Signed-off-by: Alvaro Sanchez-Leon <[email protected]>
11eba5d
to
e7edc77
Compare
What it does
Fixes: #10710, Fixes: #2819
The debuggers contribution point provides the possibility to specify
command id variables which can therefore be referenced within debug
configurations.
This change reads these contributed variables and feeds them to the
variable resolver so they can be used just before resolving values
via commands.
See "variables" at:
https://code.visualstudio.com/api/references/contribution-points#contributes.debuggers
In addition, the 'VariableResolverOptions' includes an option to
indicate if all variables were successfully resolved, this enables
to stop the processing and prevent the possibility of error
notifications e.g. in case a user did not select a valid option.
How to test
The following test uses the command "PickProcess" contributed by the
node-debug
extension.We will need to start a
node
application that we can attach to i.e. using the--inspect
option.You can use the following test application, created for this purpose:
https://github.com/alvsan09/hello_express.git
Build the application by running
localhost:3099
, make sure you see theHello world!
message and a counter incrementing every refresh.theia
Attach to node process
,NOTE: This configuration uses the following variable that needs to be resolved
"${command:PickProcess}"
node
processes select the onehello_express.js
NOTE: The fact that a list of node processes is presented for selection is an indication of the successful resolution of the command variable mentioned in the previous step.
hello_express.js
in editor and place a break point inside theget
block. The break point shall become active.node
processes e.g. pressing escape or clicking outside of the options area.Review checklist
Reminder for reviewers