entlicher commented on a change in pull request #2987:
URL: https://github.com/apache/netbeans/pull/2987#discussion_r645641996



##########
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);

Review comment:
       Yes. If we would not ask again, the user would have no way to change the 
values.
   If you attach often to some particular destination, you should put it into 
the launch.json, IMHO.
   I tried to do the best with what we can do in VSCode, but suggestions are 
welcomed, of course.




-- 
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

Reply via email to