microsoft / microsoft/vscode-java-debug
Setting shortenCommandLine "argfile" should not nest a user-passed argfile inside an argfile
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 591
- 派生
- 429
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 19
描述
When setting shortenCommandLine to argfile (or setting to auto and then triggering the argfile behavior with a long command), VS Code will always put any vmArgs inside an argfile, even if the only VM arg is another argfile. This breaks run configurations that pass a user-generated argfile that still trigger the automatic CLI shortening behavior such as a very long classpath, since argfiles cannot be nested.
Environment
- Operating System: Linux
- JDK version: 17
- Visual Studio Code version: 1.84.0-insider (
60182c7e1a666961ded4d0319c154f52d85daf30) - Java extension version: v0.25.15
- Java Debugger extension version: v0.54.0
Steps To Reproduce
- Create a trivial Java project ex. a Hello World main method
- Create an argfile
myargs - Create
launch.jsonwith a corresponding run configuration for the main method. SetshortenCommandLinetoargfileto force the argfile behavior (should be equivalent to settingautoand then loading a very long classpath).
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Hello",
"request": "launch",
"mainClass": "Hello",
"vmArgs": "@myargs",
"shortenCommandLine": "argfile"
}
]
}
- Attempt to run the main method - this should fail.
Sample project: test-argfile.tar.gz
Current Result
$ /usr/bin/env /path/to/jdk @/tmp/cp_7ifzraqswz8cni6w2z8m6nw3w.argfile Hello
Error: Could not find or load main class @myargs
Caused by: java.lang.ClassNotFoundException: @myargs
/tmp/cp_7ifzraqswz8cni6w2z8m6nw3w.argfile contents:
@myargs -XX:+ShowCodeDetailsInExceptionMessages -cp "/home/justinw/.vscode-server-insiders/data/User/workspaceStorage/-2d922411/redhat.java/jdt_ws/test-argfile_31bc6c61/bin"
Expected Result
Program should execute and argfiles should not be nested
Additional Informations
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从使用 vmArgs、shortenCommandLine 和用户创建的 myargs 文件的 Java 启动配置开始,然后按照提供的 Hello World 步骤重现失败。跟踪调试器如何构建临时 argfile;完成的标准是程序执行时不会嵌套用户传入的 argfile。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, typescript, vscode
- 领域
- devtools, tooling
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100