microsoft / microsoft/TypeScript

Feature Request: Update wrong defined import statements?

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

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

Awaiting More Feedback Suggestion
Ngôn ngữ chính
Go
Star
111k
Fork
14.4k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
117

Mô tả

I wonder if there is a feature in vscode to automatically delete imports that are incorrectly defined? Like this:

image

There is no function named "getData" from "response.ts". Because that function is moved somewhere else within the project. I ask this because incorrectly defined import statements are not deleted automatically by "removeUnusedImports". Because they are used in the file.

In fact, if it could be deleted, then the "addMissingImports" command could do its job and add these imports to the file, so that we could see that the function that was moved in the project was imported from the right place.

PLUS, it would be great if this feature could work when functions are relocated, just like vscode detects when files are relocated and updates the imports. But I am not sure about feasibility of this.

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 kiểm tra cách các lệnh removeUnusedImports và addMissingImports hiện có xử lý các import có hàm được export đã được di chuyển. Xác định hành vi mong đợi đối với các import được định nghĩa không chính xác và các hàm được di dời, sau đó xác minh rằng tính năng được đề xuất có thể xác định đúng nguồn mới mà không xóa các import hợp lệ.

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

Đánh giá

Công nghệ
javascript, typescript
Lĩnh vực
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
25/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.