microsoft / microsoft/TypeScript

Intellisense: deprioritise native function methods

Đang mở
#61,426 2 bình luận 2 reaction 1 người được giao Xem trên GitHub

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

Experience Enhancement Help Wanted Suggestion
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ả

### 🔍 Search Terms

native methods apply bind deprioritise autocomplete

### ✅ Viability Checklist

- [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
- [x] This wouldn't change the runtime behavior of existing JavaScript code
- [x] This could be implemented without emitting different JS based on the types of the expressions
- [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- [x] This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- [x] This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals

### ⭐ Suggestion

In autocomplete on a function, it would be great if TypeScript could prioritise extra methods/properties over the native ones.

### 📃 Motivating Example

Bun has some APIs that exist on a function, for example `Bun.inspect()` and also `Bun.inspect.table`. When typing `Bun.inspect.` the first few suggestions are more likely not as useful as the extra properties

Here I would have preferred for `.custom` and `.table` to be first in the list:

![Image](https://github.com/user-attachments/assets/aa19d9a5-ae80-4784-96ac-55f45adc1b8b)

### 💻 Use Cases

1. What do you want to use this for?: Would make it easier for the developer to discover often more useful methods and properties
2. What shortcomings exist with current approaches?: Extra methods/props are more difficult to see
4. What workarounds are you using in the meantime?: N/A

I would be very happy to help implement this, with some guidance as to roughly where I should look to implement it! Cheers.

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.