microsoft / microsoft/TypeScript

Expose more internal api for making language service plugins.

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

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

Awaiting More Feedback 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

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 the ts.formatting.*
  • ts.TypeChecker.getTrueType() ts.TypeChecker.getFalseType()
    The TypeFlags.BooleanLiteral is not enough to determine it is true or false.

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

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 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

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.