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

token_stream and skip_document inconsistency

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 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ệ
c, ruby
Lĩnh vực
documentation, tooling

Hướng nghiên cứu

Bắt đầu với bản tái hiện bằng C được cung cấp và kiểm tra cách RDoc liên kết token_stream với các phương thức dùng chung một nguồn, đặc biệt là cách xử lý skip_description và call-seq. So sánh các phương thức bị ảnh hưởng được liệt kê và xác nhận rằng phương thức bị bỏ qua khỏi call-seq không trở thành định nghĩa chính; công việc được xem là hoàn tất khi các mô tả và nút chuyển đổi Source đều khả dụng nhất quán cho các alias.

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

Mô tả

Complex#conjugate have token_stream but marked as skip_document

Complex#conjugate has ▶︎Source toggle but description is skipped.
Complex#conj has document but ▶︎Source is not available.

The behavior of this bug looks similar to #1335 but the cause is different.

skip_description
# Whether to skip the method description, true for methods that have
# aliases with a call-seq that doesn't include the method name.

I think this design decision makes sense. There is a room for discussion whether we really need to generate duplicated document for the same method.

token_stream

Among method/aliases with the same source, RDoc seems to select one main method. token_stream is associated to that method object.
RDoc shouldn't select description-skipped method object as main method.

Reproduction code

/*
 * call-seq:
 *   conj -> complex
 * Description
 */
VALUE rb_complex_conjugate(VALUE self){return Qnil;}
void Init_Foo(){
    rb_cComplex = rb_define_class("Complex", rb_cObject);
    rb_define_method(rb_cComplex, "conjugate", rb_complex_conjugate, 0);
    rb_define_method(rb_cComplex, "conj", rb_complex_conjugate, 0);
}

RDoc thinks the first define_method (conjugate) is the main definition. token_stream is associated to it. But conjugate is not in call-seq.

Methods that have this problem

Complex#conjugate
Complex#imaginary
Complex#rectangular
Enumerable#collect
Enumerable#find_all
Enumerable#member?
Forwardable#instance_delegate
Hash#initialize_copy
IO#each
Integer#===
MatchData#eql?
Numeric#conjugate
Numeric#imaginary
Numeric#rectangular
ObjectSpace::WeakMap#include?
Range#member?
Regexp#eql?
SingleForwardable#single_delegate
StringIO#each
StringIO#eof
Time#getgm
Time#gmtime
Time#gmtoff
Time#isdst
Time#tv_nsec
Time#tv_usec
Ngôn ngữ chính
Ruby
Star
927
Fork
467
Merge trung bình
23 giờ 47 phút
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

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 ruby/rdoc

Tất cả issue của ruby/rdoc

Issue tương tự

Thêm issue về Ruby

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.