C parser drops docs under namespace variables defined in another file
Maintainer thường phản hồi trong vòng 1 ngà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
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- documentation, tooling
Hướng nghiên cứu
Theo dõi cách C parser xử lý rb_define_const và các định nghĩa method, so sánh việc tra cứu @known_classes cục bộ của parser với việc tra cứu enclosure dựa trên store được rb_define_class_under và rb_define_module_under sử dụng. Xác minh hành vi bằng ví dụ mFoo gồm hai file: các constant và method được định nghĩa sau mFoo trong một file khác phải xuất hiện dưới Foo mà không cần một comment seed giả.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
C parser drops docs for entries under a namespace variable defined in another file
RDoc's C parser appears unable to resolve extension namespace variables across C files for constants and methods.
Example:
/* foo.c */
VALUE mFoo;
void Init_foo(void) {
mFoo = rb_define_module("Foo");
}
/* constants.c */
rb_define_const(mFoo, "VERSION", rb_str_new_cstr("1.0.0"));
In this shape, RDoc does not know what mFoo means while parsing constants.c, so Foo::VERSION is not documented.
There is partial cross-file support for _under definitions, such as:
/* bar.c */
VALUE cBar = rb_define_class_under(mFoo, "Bar", rb_cObject);
That can work because rb_define_class_under / rb_define_module_under goes through a store-backed enclosure lookup. In other words, when RDoc is creating a class or module, it has a special path that can sometimes find the enclosing C variable from another parsed file or cache.
Constants and methods do not appear to use the same path. They only check the parser-local @known_classes map, and if mFoo is missing, the entry is silently skipped.
A workaround is to add a fake seed comment in each C file:
/* RDoc parses C files independently: mFoo = rb_define_module("Foo") */
Because RDoc scans block comments for rb_define_* patterns, this seeds mFoo => Foo for that file and documentation is generated.
Expected behavior: once mFoo is defined in one parsed C file, later C files should be able to document constants and methods under Foo, or RDoc should provide a documented way to seed cross-file C namespace variables.
- 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
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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.
Issue khác của ruby/rdoc
-
RDoc 8.0.0 gem omits `doc/rdoc/example.rb`, which is referenced by the packaged markup documentationCó thể đã có người làm @OskarEichler đã nhận 43 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
ruby/rdoc#1759 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Regexp generated from unescaped input in #expand_classCó thể đã có người làm @jaynetics đã nhận 2 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
ruby/rdoc#1823 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Wrong heading levels in generated HTML?Có thể đã có người làm @st0012 đã nhận 8 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
ruby/rdoc#1822 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
sclorg/s2i-ruby-container#660 · 1 bình luận ·
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
bridgetownrb/bridgetown#1130 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
rapid7/metasploit-framework#22008 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
stripe/stripe-ruby#1994 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Fehler]: /abdeckstift wirft 500 — part_type aus der Phonemreduction-Umbenennung nicht mitgezogenĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
wort-schule/wort.schule#787 ·