entlicher commented on a change in pull request #2987:
URL: https://github.com/apache/netbeans/pull/2987#discussion_r645638349
##########
File path: java/java.lsp.server/vscode/src/extension.ts
##########
@@ -705,13 +732,38 @@ class NetBeansConfigurationProvider implements
vscode.DebugConfigurationProvider
request: "attach",
};
for (let i = 0; i < ac.arguments.length; i++) {
- debugConfig[ac.arguments[i]] = ac.defaultValues[i];
+ let defaultValue: string = ac.defaultValues[i];
+ if (!defaultValue.startsWith("${command:")) {
+ // Create a command that asks for the argument value:
+ let cmd: string = "java.attachDebugger.connector." +
ac.id + "." + ac.arguments[i];
+ debugConfig[ac.arguments[i]] = "${command:" + cmd +
"}";
+ if (!commandValues.has(cmd)) {
+ commandValues.set(cmd, ac.defaultValues[i]);
+ let description: string = ac.descriptions[i];
+
context.subscriptions.push(commands.registerCommand(cmd, async (ctx) => {
+ return vscode.window.showInputBox({
+ prompt: description,
+ value: commandValues.get(cmd),
+ }).then((value) => {
+ if (value) {
+ commandValues.set(cmd, value);
+ }
+ return value;
+ });
+ }));
+ }
+ } else {
+ debugConfig[ac.arguments[i]] = defaultValue;
Review comment:
Yes, it's up to the client to provide a way how user can customize the
connector attributes. The server sends some defaults which it gets from JVM.
The default for a hostName is the host name of the local machine, for instance.
To connect somewhere else, you need to customize it on the client.
Instead of the current necessity to put the configuration into launch.json
and edit it there, we provide commands that ask for the user input. The
configurations usually can not work just with the defaults.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists