redhat-developer / redhat-developer/vscode-java
Preventing .classpath overwrite
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 546
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
Hello,
While I'm fully aware that Android projects are unsupported, manually crafting .classpath files provide quite satisfying results - with the caveat that they don't support env vars, so you have to hardcode the path to your Android SDK.
For example, with a classpath that looks like:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="lib" path="/Users/arnaud/dev/android-sdk/platforms/android-26/android.jar" />
</classpath>
I'm able, after indexing, to get completion for my project's classes, but also Android's.
Libraries need a little more work, but I don't mind doing everything manually, as both the platform version and libraries don't change often.
The problem is that vscode-java notices that this is a gradle project, and will overwrite.
I have to rewrite the .classpath with my version every time I reopen vscode.
I'd like to have a setting to tell the plugin never to overwrite .classpath on its own.
Environment
- Operating System: macOS & Windows
- JDK version: 1.8
- Visual Studio Code version: 1.15.1
- Java extension version: Latest as of writing
Steps To Reproduce
- Open a
- Patch the .classpath yourself. Make sure you back it up somewhere else
- Restart vscode
Current Result
.classpath was overwritten with an empty one
Expected Result
.classpath should have not been overwritten
Additional Informations
I tried setting " "java.configuration.updateBuildConfiguration": "disabled" ", but that does not help
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用手动编辑的 .classpath 和 java.configuration.updateBuildConfiguration 设置重现重启工作流。比较重新打开 VS Code 前后的文件,然后跟踪扩展对 Gradle 项目的处理。完成标准是:有一个文档化的设置可以防止自动覆盖 .classpath,同时仍可进行正常的项目更新。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, typescript
- 领域
- build-system, devtools, tooling
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100