Escape does not cancel a launch that uses command:SpecifyProgramArgs
@testforstephen arbeitet bereits daran.
Seit 28.2.2024.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
When launching a Java program with ${command:SpecifyProgramArgs}, the popup says that I can press 'Escape' to cancel, but it runs anyway.
Environment
- Operating System: Windows 11
- JDK version: 17.0.4.1
- Visual Studio Code version: 1.86.2
- Java extension version: 1.28.1
- Java Debugger extension version: 17.0.4.1
Steps To Reproduce
- Open the repo https://github.com/sbj42/vscode-specifyprogramargs
- Open
Test.javaand pressF5. - Pop-up appears with "Press 'Enter' to confirm your input or 'Escape' to cancel".
- Press Escape.
- Terminal appears and runs the test program with no arguments.
See repo above, but you only need these two files:
Test.java:
public class Test {
public static void main(String[] args) {
System.out.println("args: " + String.join(" ", args));
}
}
.vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Launch with Arguments Prompt",
"request": "launch",
"mainClass": "",
"args": "${command:SpecifyProgramArgs}"
}
]
}
Verbose output log from "Language Support for Java": log.txt
Current Result
The debug session starts with no arguments.
Expected Result
The debug session should not start, because it was cancelled.
Additional Informations
The implementation of SpecifyProgramArgs is at extension.ts:185. When the user cancels, the function returns a string with a single space. That's indistinguishable from the user entering a space in the input.
I presume that throwing some sort of cancellation exception would be good here, for instance throw new Error('Launch cancelled'). It would be even better if the exception didn't display an error box, but I don't know enough about vscode extension command handlers to know if that's possible.
Alternatively you could just remove the "or 'Escape' to cancel" hint in the input popup.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 591
- Forks
- 429
- Ø Merge
- 1 T. 3 Std.
- Gemergte PRs (30 T.)
- 19
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/vscode-java-debug
-
ai-triaged bug
microsoft/vscode-java-debug#1703 · 1 Kommentar · 1 Reaktion · 1 zugewiesene Person ·
-
ai-triaged enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
microsoft/vscode-java-debug#1689 · 2 Kommentare ·
-
ai-triaged bug
microsoft/vscode-java-debug#1666 · 1 Kommentar · 1 zugewiesene Person ·
-
ai-triaged bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
microsoft/vscode-java-debug#1658 · 1 Kommentar ·
-
ai-triaged enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
microsoft/vscode-java-debug#1628 · 3 Kommentare ·
Alle Issues in microsoft/vscode-java-debug
Ähnliche Issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
-
Mend: dependency security vulnerability untriaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100