Skip to content

More flexible documentation for R6 methods#1806

Closed
hadley wants to merge 4 commits intomainfrom
r6method-tag
Closed

More flexible documentation for R6 methods#1806
hadley wants to merge 4 commits intomainfrom
r6method-tag

Conversation

@hadley
Copy link
Copy Markdown
Member

@hadley hadley commented Mar 13, 2026

@hadley hadley requested a review from gaborcsardi March 13, 2026 12:58
Copy link
Copy Markdown
Member

@gaborcsardi gaborcsardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. AFAICT this does not solve one of the original issues (#931) because there the methods are added with $set() dynamically in a loop. OTOH that issue is probably solved best with dynamically generating the documentation as well, using `r ...`.

I am a bit worried about the edge cases, e.g. what if people put @R6method inside the R6 class, right before the method?

@hadley
Copy link
Copy Markdown
Member Author

hadley commented Mar 16, 2026

I think if you're dynamically generating the methods, you could still dynamically generate the roxygen comments, either by writing to a file or (maybe) with @eval (depending on exactly when that's run in the process).

I probably won't merge this PR because I've decided it makes sense to tackle a bigger refactoring first: I want to add an intermediate layer of rd_ objects to make it easier to test generating the R6 object model vs generating the .Rd output.

@hadley
Copy link
Copy Markdown
Member Author

hadley commented Mar 18, 2026

Superseded by #1824

@hadley hadley closed this Mar 18, 2026
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.

Document R6 methods created on $new()/$initialize() Documentation for R6 methods added dynamically by "$set()"

2 participants