Conversation
Documentation previewCommit: |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Non-signature trailing comments are incorrectly treated as RBS signatures.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
What changed in this PR
Updates Ruby attribute parsing to recognize RBS signatures only as trailing inline annotations.
Changes:
- Reads attribute signatures from modifier comments.
- Preserves preceding documentation comments.
- Adds typed and untyped attribute coverage.
| File | Description |
|---|---|
lib/rdoc/parser/ruby.rb |
Extracts inline attribute type signatures. |
test/rdoc/parser/ruby_test.rb |
Tests attribute signatures and documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
63c52cb to
3064c10
Compare
3064c10 to
7692cce
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Multiline attribute declarations silently lose valid trailing signatures because lookup uses the call’s start line.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
Resolved since last review (1)
They are only effective when on the same line like `attr_reader :foo #: Bar` https://github.com/ruby/rbs/blob/6c775eec9b6f285a6921aa753f606cd4bcdc83ab/docs/inline.md#attributes
7692cce to
54e5f4f
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Attribute validation incorrectly accepts method signatures that RBS rejects for attributes.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
Resolved since last review (1)
| type_signatures_from([comment], line_no) | ||
| end | ||
|
|
||
| def type_signatures_from(sig_lines, first_sig_line) | ||
| sig_lines = sig_lines.map { |line| line.sub(RBS_SIG_LINE, '').strip }.reject(&:empty?) |

They are only effective when on the same line like
attr_reader :foo #: Barhttps://github.com/ruby/rbs/blob/6c775eec9b6f285a6921aa753f606cd4bcdc83ab/docs/inline.md#attributes