microsoft / microsoft/TypeScript

Missing auto-import for subpath imports of other local packages

Đang mở
#63,803 6 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 2/4/2026.

Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

### Extension Version

0.20260303.1

### VS Code Version

1.108

### Operating system Version

Ubuntu 24

### Steps to reproduce

1. Clone example repo https://github.com/psznm/subpath-ts.git
2. npm install
3. try auto-import in main2.ts

### Issue

When using npm workspace local workpaces are linked to node_modules. Subpath imports can then point to that package.
In example repository [package.json](https://github.com/psznm/subpath-ts/blob/master/pkg1/package.json) of pkg1 has various imports specified. #pkg1 and #pkg2 are problematic subpaths specified to their respective packages. #pkg3 and #pkg4 are relative subpaths.

But in [main2.ts](https://github.com/psznm/subpath-ts/blob/master/pkg1/src/nested/nested2/main2.ts) only two autoimports are offered as can be seen in image below. Neither relative, nor package subpath for pkg2 works.

Image

Probably all other subpaths should be offered for auto-import. Or at least one from the other package to cover all unique paths.

Also note that this did not work with strada either. Created this here only [due to this](https://github.com/microsoft/TypeScript/issues/62827)

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.