microsoft / microsoft/TypeScript

AllowUnresolveNames not working for completion getters/setters and property signature and declaration

Đang mở
#59,554 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.

Domain: LS: Refactorings Experience Enhancement 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ả

🔎 Search Terms

AllowUnresolveNames, "preserve type nodes"

🕗 Version & Regression Information
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about AllowUnresolvedNames and preserve types
⏯ Playground Link

https://www.typescriptlang.org/play/?target=99#code/JYOwLgpgTgZghgYwgAgILIN4Chm+TAewIC5lgBbABwKjAAoAiAOgHoATAiAZ3AgA9gXMEwBWXBgEomAMSIBuHHgDmEMMgBGcKHQmkK1Wo1YduvAUNHipsggoC+WRwgA2cLl2QAhMlWcRyEOAe6NgsLMgAKlDASipQyAgEvqrABCCkDPp+AeBkvLCIKKgMyGyClK4AnshgABaCCUkVKWnEWGFoCGAArnDObR2EJMhwIJUKHSpqmtq6I2OY7eF4NbVQBADuyCAQWwCiUOvaDACyqrUEbNsEaln+gZBsTJIT4XbIjh17fJQQXRBsAbhIZ6Kg0ejMdicHiQczCMSSGTyJbIKYaLQ6UEGCHGaFmQTwqxIgiLDorOrrLY7faHGiMM51S7XW7JHKPZ4SV7Id5YOxAA

💻 Code
interface A {
    foo: import("./doesntexist.js").Foo;
    get bar(): import("./doesntexist.js").Foo;
}


class B implements A {
// Trigger completion: "implement interface A" display this completion:
// Actual:
// foo: any;
// get bar(): any {
//     throw new Error("Method not implemented.");
// } 

// Expected:
// foo: import("./doesntexist.js").Foo;
// get bar(): import("./doesntexist.js").Foo {
//     throw new Error("Method not implemented.");
// } 
}
🙁 Actual behavior

Triggering completion uses any instead of the unresolved type.

🙂 Expected behavior

Completion should be the unresolved type instead of any

Additional information about the issue

Found in PR https://github.com/microsoft/TypeScript/pull/59440

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 với hành vi hoàn tất được tái hiện trong Playground được liên kết khi triển khai interface A, tập trung vào các getter/setter hoàn tất và các khai báo thuộc tính. So sánh đầu ra any thực tế với kiểu import chưa được phân giải dự kiến; được coi là hoàn tất khi tất cả các mục hoàn tất được hiển thị đều giữ nguyên import("./doesntexist.js").Foo thay vì sử dụng any.

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

Đánh giá

Công nghệ
typescript
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 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
48/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.