Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

The trailing newline character in line comments is not properly scoped

Đang mở
#810 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.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng cách xác định quy tắc grammar TextMate của TypeScript gán scope cho các chú thích dòng, sau đó so sánh cách quy tắc này xử lý ký tự xuống dòng kết thúc với hành vi được báo cáo của Sublime Text. Được xem là hoàn tất khi ký tự xuống dòng được gán scope như một phần của chú thích dòng, đồng thời vẫn duy trì hỗ trợ cho các trình chỉnh sửa được nêu trong phần mô tả repository; issue không xác định tệp kiểm thử nào.

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

Mô tả

TypeScript Sublime Package version: 3.8.2

As the syntax currently stands, the newline character that terminates a line comment is not scoped as being a part of the comment body itself. This causes various issues in Sublime Text in particular, although not being familiar with the other editors that are also using this syntax I'm not sure if there's a reason why this is the case or not.

For example, in Sublime the auto_complete_selector setting is used to control in what circumstances the autocompletion popup will automatically trigger. The general practice is to include source - comment in this setting to stop autocompletion from happening inside of a comment, since that is rarely useful. Since the newline isn't scoped, the autocomplete popup triggers constantly while entering comments.

In addition, various plugins and commands attempt to continue comments onto the next line when pressing enter, which generally requires that the end of the current comment be scoped as a comment so as to be syntax agnostic.

In order to support this for TypeScript, extra key bindings or plugin logic to try and detect that the current position is the end of a line comment are required, which arguably is information that the syntax should be providing.

As indicated above, since I'm purely a Sublime user I'm not sure if the other editors targeted by this syntax don't exhibit such issues or if there's some other reason why the newline is not currently being scoped as a comment.

Ngôn ngữ chính
TypeScript
Star
471
Fork
149
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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.

Issue khác của microsoft/TypeScript-TmLanguage

Tất cả issue của microsoft/TypeScript-TmLanguage

Issue tương tự

Thêm issue về TypeScript

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.