Skip to content

Optional attributes - #134

Merged
skatkov merged 4 commits into
mainfrom
optional-attributes
Nov 13, 2026
Merged

skatkov merged 4 commits into
mainfrom
optional-attributes

Conversation

@skatkov

@skatkov skatkov commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Show optional positional arguments accurately in generated method headings by restoring defaults from Ruby source.

Before

Given:

def parse(source, opts = nil)

The generated heading could hide the default, making opts look required:

parse(source, opts) -> object

After

The heading preserves the source default:

parse(source, opts = nil) -> object

Default expressions are preserved without evaluating or rewriting them, including strings, hashes, regexes, interpolation, and lambdas:

split(text, separator = ",") -> Array

@skatkov
skatkov force-pushed the optional-attributes branch from 16b3ce1 to c284ec1 Compare November 13, 2026 19:46
@skatkov
skatkov merged commit e315242 into main Nov 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址