microsoft / microsoft/TypeScript

Cache importFixes/fixMissingImport in getCodeFixes requests

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

@andrewbranch đang làm issue này rồi.

Từ ngày 10/12/2020.

Needs Investigation
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ả

Search Terms

  • getCodeFixes cache

Suggestion

In tsserver, the completionInfo request benefits from a cache of import suggestions.

https://github.com/microsoft/TypeScript/blob/d156bb805eba314be2fbe86e4c4ca0179380580e/src/services/completions.ts#L1627-L1631

Could the getCodeFixes request be extended to use a suggestion imports cache as well?

https://github.com/microsoft/TypeScript/blob/2428ade1a91248e847f3e1561e31a9426650efee/src/services/codefixes/importFixes.ts#L234

Both call codeFixes.forEachExternalModuleToImportFrom, which can be very slow in a large project. Thanks!

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

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.

Đánh giá

Issue này chưa được đánh giá.

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.