Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template doc and type fixes #20

Merged

Conversation

tomas-abrahamsson
Copy link
Contributor

@tomas-abrahamsson tomas-abrahamsson commented May 11, 2022

This fixes two issues with the templates in two commits. Let me know if you would rather like these as two separate PRs. I thought there may potentially be merge conflicts since they touch adjacent lines, so to start with, I've put them as two commits in sequence.

I'll try to illustrate the problems I'm attempting to address, using the grpcbox. I know routeguide_route_guide_bhvr.erl in that repo is a git-controlled file and not generated, so the example is admittedly a bit contrived, but nevertheless shows one of the issues.

The first commit removes @doc from the generated behaviour files since this seems to not be valid edoc:

$ cd _build/test/lib/grpcbox/test/
$ erl
1> edoc:file("routeguide_route_guide_bhvr.erl").
routeguide_route_guide_bhvr.erl, in module footer: at line 10: tag @doc not allowed here.
routeguide_route_guide_bhvr.erl, in module footer: at line 14: multiple @doc tag.
routeguide_route_guide_bhvr.erl, in module footer: at line 18: multiple @doc tag.
routeguide_route_guide_bhvr.erl, in module footer: at line 22: multiple @doc tag.
routeguide_route_guide_bhvr.erl, in module footer: at line 26: multiple @doc tag.
routeguide_route_guide_bhvr.erl, in module footer: at line 30: multiple @doc tag.

The second commit fixes the ctx type reference in the generated code: ctx:ctx()ctx:t()

This is with Erlang 24.3.4.

-callbacks must not have @doc tags.
The actual ctx type is ctx:t(), not ctx:ctx().  Update the template
so the generated _bhvr.erl files get the correct type.
@tsloughter
Copy link
Owner

Thanks!

This is good, I'll fix up the doc to work later.

@tsloughter tsloughter merged commit 805d1bc into tsloughter:master May 11, 2022
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.

2 participants