redhat-developer / redhat-developer/vscode-java

Preventing .classpath overwrite

Đang mở
#285 9 bình luận 4 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug Gradle
Ngôn ngữ chính
TypeScript
Star
2.3k
Fork
546
Merge trung bình
20 giờ 1 phút
Pull request đã merge (30 ngày)
11

Mô tả

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
  1. Open a
  2. Patch the .classpath yourself. Make sure you back it up somewhere else
  3. 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện quy trình khởi động lại với một tệp .classpath được chỉnh sửa thủ công và cài đặt java.configuration.updateBuildConfiguration. So sánh tệp trước và sau khi mở lại VS Code, sau đó theo dõi cách extension xử lý dự án Gradle. Hoàn tất khi một cài đặt được ghi lại ngăn .classpath bị ghi đè tự động, trong khi các cập nhật dự án thông thường vẫn khả dụng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, typescript
Lĩnh vực
build-system, devtools, tooling
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.