microsoft / microsoft/TypeScript
External interfaces included in IDE symbol space
Chưa có ai nhận issue này.
- 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ả
#### Overview
Interfaces defined in `.d.ts` files (even if they are not part of the Visual Studio project) are nonetheless included in the IDE symbol space; i.e. they appear in the Navigate To search results.
#### Repro
Add the NuGet package `underscore.TypeScript.DefinitelyTyped` to a project. Ensure that `underscore.d.ts` is not included in the project; however, do put a reference to it in a TypeScript file in the project, e.g.
```
///
```
In Visual Studio, press Ctrl + , and type `reduce`. Notice you get lots of listings for methods defined in the underscore interface.
#### Commentary
The repro steps are analogous to adding a reference to `System.Web.Mvc`, hitting Ctrl + ,, typing `file`, and seeing the `File` methods for `System.Web.Mvc.Controller`, plus who knows what else. Of course, for assembly references this doesn't happen; it would be noise, polluting the IDE symbol space with stuff you rarely want to try to navigate to. Libraries have lots of symbols, often more than our own apps. Those symbols get in the way of navigating quickly within our own app. That's why there's a switch to turn off external items. The same situation applies to JavaScript libraries with TypeScript annotations - not at the same scale as the .NET Framework, but still at enough scale to be a problem.
The bug is that for TypeScript, interfaces and their members in `.d.ts` files always show up. Ideally, they shouldn't show up regardless of whether the `.d.ts` file is referenced with an XML directive or by including the file in the project.
The main use case where it would be helpful to include the identifiers in the IDE symbol space is when developers are actually writing `.d.ts` files. To serve that need, it would be reasonable to include the symbols if the "Search within external items" option is enabled.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Tái hiện vấn đề với underscore.d.ts được tham chiếu bởi một chỉ thị XML, sau đó điều tra cách Navigate To lập chỉ mục các interface và member từ các tệp .d.ts bên ngoài. Bản sửa lỗi nên mặc định giữ các identifier đó ngoài không gian symbol của IDE, nhưng cho phép chúng khi “Search within external items” được bật.
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
- developer-experience, search
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 35/100