Repository: quarkusio/quarkus
Issue: x - open last stacktrace not working with vscode/codium

### Describe the bug

have exception occur and try use `x` to open it and you get code to open "main.java:18" which is not a syntax code supports.

example app:

```
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS io.quarkus.platform:quarkus-bom:2.6.1.Final@pom
//DEPS io.quarkus:quarkus-resteasy

//JAVAC_OPTIONS -parameters

import io.quarkus.runtime.Quarkus;
import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path("/hello-resteasy")
@ApplicationScoped
public class main {

    @GET
    public String sayHello() {
        throw new IllegalStateException("What up");
        
    }

    public static void main(String[] args) {
        Quarkus.run(args);
    }
}
```

### Expected behavior

_No response_

### Actual behavior

_No response_

### How to Reproduce?

_No response_

### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

_No response_

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

_No response_

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

_No response_

### Additional information

_No response_

Changed files:
core/deployment/src/main/java/io/quarkus/deployment/console/ConsoleProcessor.java
core/deployment/src/main/java/io/quarkus/deployment/ide/Ide.java

diff --git a/core/deployment/src/main/java/io/quarkus/deployment/console/ConsoleProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/console/ConsoleProcessor.java
index 3182290ffd1..e945ece2c64 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/console/ConsoleProcessor.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/console/ConsoleProcessor.java
@@ -156,6 +156,7 @@ public void run() {
                     List<String> command = new ArrayList<>();
                     command.add(effectiveCommand);
                     command.addAll(args);
+                    log.debugf("Opening IDE with %s", command);
                     new ProcessBuilder(command).redirectOutput(ProcessBuilder.Redirect.DISCARD)
                             .redirectError(ProcessBuilder.Redirect.DISCARD).start().waitFor(10,
                                     TimeUnit.SECONDS);
diff --git a/core/deployment/src/main/java/io/quarkus/deployment/ide/Ide.java b/core/deployment/src/main/java/io/quarkus/deployment/ide/Ide.java
index 5c13170cc6f..50959a7d7e7 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/ide/Ide.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/ide/Ide.java
@@ -3,32 +3,36 @@
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+import org.jboss.logging.Logger;
 
 import io.quarkus.dev.console.DevConsoleManager;
 
 public enum Ide {
 
     // see for cli syntax of idea https://www.jetbrains.com/help/idea/opening-files-from-command-line.html
-    IDEA("idea", null, "--help"),
-    ECLIPSE("eclipse", null, (String[]) null),
-    VSCODE("code", null, "--version"),
-    NETBEANS("netbeans", null, "--help");
+    IDEA("idea", List.of("--line", "{lineNumber}", "{fileName}"), List.of("--help")),
+    ECLIPSE("eclipse", List.of("--launcher.openFile", "{fileName}:{lineNumber}"), Collections.emptyList()),
+    VSCODE("code", List.of("--goto", "{fileName}:{lineNumber}"), List.of("--version")),
+    NETBEANS("netbeans", Collections.emptyList(), List.of("--help"));
+
+    private static final Logger log = Logger.getLogger(Ide.class);
 
     private final String defaultCommand;
     private final List<String> markerArgs;
-    private final String lineNumberArg;
+    private final List<String> lineNumberArgs;
     private String machineSpecificCommand;
 
     private String effectiveCommand;
 
-    Ide(String defaultCommand, String lineNumberArg, String... markerArgs) {
+    Ide(String defaultCommand, List<String> lineNumberArgs, List<String> markerArgs) {
         this.defaultCommand = defaultCommand;
-        this.lineNumberArg = lineNumberArg;
-        this.markerArgs = markerArgs != null ? Arrays.asList(markerArgs) : Collections.emptyList();
+        this.lineNumberArgs = lineNumberArgs;
+        this.markerArgs = markerArgs;
     }
 
     /**
@@ -46,7 +50,7 @@ public String getEffectiveCommand() {
 
     private String doGetEffectiveCommand() {
         if (defaultCommand != null) {
-            if (markerArgs == null) {
+            if (markerArgs.isEmpty()) {
                 // in this case there is nothing much we can do but hope that the default command will work
                 return defaultCommand;
             } else {
@@ -54,6 +58,7 @@ private String doGetEffectiveCommand() {
                     List<String> command = new ArrayList<>(1 + markerArgs.size());
                     command.add(defaultCommand);
                     command.addAll(markerArgs);
+                    log.debugf("Checking if IDE available with %s", command);
                     new ProcessBuilder(command).redirectError(ProcessBuilder.Redirect.DISCARD.file())
                             .redirectOutput(ProcessBuilder.Redirect.DISCARD.file()).start()
                             .waitFor(10,
@@ -75,13 +80,16 @@ public List<String> createFileOpeningArgs(String fileName, String line) {
             return Collections.singletonList(fileName);
         }
 
-        if (lineNumberArg == null) {
-            return Collections.singletonList(fileName + ":" + line);
+        // we don't know the syntax for opening a file at a given line
+        // so we just open the file
+        if (lineNumberArgs.isEmpty()) {
+            log.debug("No syntax provided for opening the file at a given line for this IDE so we will just open the file");
+            return Collections.singletonList(fileName);
         }
 
-        String formattedLineArg = String.format(lineNumberArg, line);
-
-        return List.of(formattedLineArg, fileName);
+        return lineNumberArgs.stream()
+                .map(arg -> arg.replace("{fileName}", fileName).replace("{lineNumber}", line))
+                .collect(Collectors.toList());
     }
 
     public void setMachineSpecificCommand(String machineSpecificCommand) {