microsoft / microsoft/TypeScript
Expose more internal api for making language service plugins.
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ả
Search Terms
language service plugin api refactor codefix vscode
Suggestion
ts.refactor.registerRefactor
A more standard way to make refactor rather than hook the language servies functions.
And refactor is a rare api that I do not need to write ui code or command for vscode.ts.textChanges.*
Use this, I can easily generate code or modify code that conform the current code format style.
Especially you don't expose thets.formatting.*ts.TypeChecker.getTrueType()ts.TypeChecker.getFalseType()
TheTypeFlags.BooleanLiteralis not enough to determine it istrueorfalse.
Use Cases
https://github.com/heroboy/generate-typescript-switch-case-for-enum-type-language-service-plugin
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
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
Bắt đầu bằng việc xem xét các API của plugin dịch vụ ngôn ngữ TypeScript và các entry point được yêu cầu: ts.refactor.registerRefactor, ts.textChanges., ts.formatting. và TypeChecker.getTrueType()/getFalseType(). So sánh chúng với use case generate-typescript-switch-case-for-enum-type-language-service-plugin được liên kết; để được xem là hoàn tất, cần có một đề xuất public API với phạm vi được xác định và thống nhất, thay vì triển khai tất cả các yêu cầu được liệt kê.
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
- compilers, devtools
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 20/100