roxygen2 icon indicating copy to clipboard operation
roxygen2 copied to clipboard

Consider removing the `pkg::` prefix in the `Super classes` section when parent classes originate from the same package

Open arnaudgallou opened this issue 2 years ago • 0 comments

Currently roxygen2 generates the Super classes section as follows:

pkg::ClassA -> pkg::ClassB -> ... -> pkg::ClassN

Although I understand the point of specifying the name of the package when extending a class that comes from another package, I think it makes it:

  1. Harder to read and redundant when using many subclasses that originate from the same package, especially when using long package and class names.
  2. Potentially confusing when not exporting parent classes because the :: suggests that classes are actually exported.

Here's an example from one of my packages where parent classes are all internal objects.

IMO, it would look cleaner and less confusing for users if I could get rid of the pkg:: prefix for parent classes (as long as they all belong to the same package).

arnaudgallou avatar Jan 10 '24 10:01 arnaudgallou