Escape does not cancel a launch that uses command:SpecifyProgramArgs
@testforstephen 已經在處理了。
開始於 2024年2月28日。
評估
這個 Issue 還沒有評估資料。
描述
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.
- 主要語言
- TypeScript
- 星號
- 591
- 分支
- 429
- 平均合併
- 1 天 9 小時
- 30 天內合併 PR
- 19
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/vscode-java-debug 的其他 Issue
-
ai-triaged enhancement
難度 3/5 1-2 天 新手友好度 55/100
microsoft/vscode-java-debug#1689 · 2 則留言 ·
-
ai-triaged bug
microsoft/vscode-java-debug#1666 · 1 則留言 · 已指派 1 人 ·
-
ai-triaged bug
難度 3/5 1-2 天 新手友好度 48/100
microsoft/vscode-java-debug#1658 · 1 則留言 ·
-
ai-triaged enhancement
難度 4/5 3-5 天 新手友好度 45/100
microsoft/vscode-java-debug#1628 · 3 則留言 ·
-
Feature support. 未關閉ai-triaged enhancement
難度 5/5 一週以上 新手友好度 25/100
microsoft/vscode-java-debug#1616 · 1 則留言 ·
查看 microsoft/vscode-java-debug 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
0xMiden/bridge-portal#132 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 2/5 1-3 小時 新手友好度 82/100
-
area:tools bug good first issue help wanted priority:P2
難度 2/5 1-3 小時 新手友好度 90/100
TaewoooPark/Motifcode#14 ·
-
bug
難度 2/5 1-3 小時 新手友好度 84/100
newrelic-experimental/preflight#793 · 1 則留言 ·