redhat-developer / redhat-developer/vscode-java

Q: Is there a way from my project to programmatically detect that it is in vscode

Đang mở
#1,155 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Gradle question
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ả

I have a situation where a Gradle plugin I'm developing needs to take conditional actions depending on whether or not the project in which my Gradle plugin is applied, is currently being edited inside vscode.

I'm wondering if there might be someway for any random Java code that is part of a project, to programmatically detect that the project is currently opened in vscode.

Maybe something like querying the hierarchy of class loaders to see if some class that is only ever loaded by vscode-java is present? Or maybe there is something like a .lock file somewhere that would only exist if vscode-java is editing a specific project? Anything like that?

I realize I could have the code look in the root folder to see if a .vscode folder is there — or something along those lines. But I very often open projects in all of the different Java IDEs at different times. So although the project might be open in IntelliJ at any given time, it would be a false positive in the IntelliJ scenario when the detection code finds a .vscode folder from the previous times I might have edited the project in vscode.

Environment
  • Operating System: Windows/Linux/Mac OS
  • JDK version: Java 1.5 to Java 13+
  • Visual Studio Code version: 1.40.1 (system setup)
  • Java extension version: 0.53.1
  • Gradle 3.x - 6.x
Steps To Reproduce

Not Applicable

Current Result

Not Applicable

Expected Result

Not Applicable

Additional Informations

Not Applicable

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

Issue không nêu tên tệp repository, các bài kiểm thử hoặc các điểm bắt đầu của việc triển khai; issue đặt câu hỏi liệu mã Java có thể phát hiện một project đang được mở trong VS Code hay không. Hãy bắt đầu bằng việc xem xét ngữ cảnh của issue và phần tích hợp tiện ích mở rộng VS Code của repository, sau đó xác định xem đã có một thay đổi được giới hạn phạm vi và có thể kiểm thử hay chưa. Done chưa được chỉ định vì thread chỉ chứa một câu hỏi.

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, vscode
Lĩnh vực
developer-experience, tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
15/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.