crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.38k stars 1.62k forks source link

Missing inherited methods sections #15053

Open Blacksmoke16 opened 3 days ago

Blacksmoke16 commented 3 days ago

I think this is a regression from https://github.com/crystal-lang/crystal/pull/14910, but haven't expcliitly confirmed it yet. Basically a repeat of https://github.com/crystal-lang/crystal/pull/14878#issuecomment-2288744060.

On latest 1.13 release: https://crystal-lang.org/api/1.13.3/Array.html, you can see the Included Modules section and related methods inherited from ... sections from those modules at the end of the method summaries.

However on master: https://crystal-lang.org/api/master/Array.html, Included Modules and the inherited methods sections of those modules are missing.

spuun commented 2 days ago

Yes, seems to be related to #14910, that it's exposing a bug for Crystal::Doc::Generator#must_include?. I don't think it's handling generic types correct.

Adding

  def must_include?(type : Crystal::GenericInstanceType)
    type = self.type(type.generic_type)
    must_include? type
  end

seems to do the trick.

straight-shoota commented 2 days ago

For future reference: I compared the doc output from #15055 against master using diff on index.json.

$ git checkout master
$ make docs
$ mv docs docs-master
$ git checkout $branch
$ make crystal docs
$ diff <(jq 'del(.. | .url?)' docs-master/index.json) <(jq 'del(.. | .url?)' docs/index.json)

jq 'del(.. | .url?)' pretty prints the JSON for line-based diffing, and it removes all url attributes because they differ between every commit (they are permalinks to the specific commit version of the source file).

I haven't found an easy way to compare the HTML output. There's a lot more noise there and harder to filter out. index.json should usually be fine to assess doc generator content output.