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

proto comments are not transferred in the generated files #198

Closed
anmolitor opened this issue Apr 4, 2023 · 1 comment
Closed

proto comments are not transferred in the generated files #198

anmolitor opened this issue Apr 4, 2023 · 1 comment

Comments

@anmolitor
Copy link
Owner

.proto files can be documented by leaving comments in the file, which are picked up by protoc and exposed
as SourceCodeInfo. We could use that info to move the comments to fitting places in the generated elm code.

Example:

// A simple message
message Simple {
  // a field containing a string
  string field = 1;
}
{- |  A simple message -}
type alias Simple = {
  -- a field containing a string
  field : String
}
@anmolitor
Copy link
Owner Author

Elm Syntax DSL does not support comments outside of the root scope. It's not easy to add, since it aims to be compatible with elm-format, plus elm-syntax does not support it either, so it is an upstream issue. Therefore elm codegen has the same limitation.

Issue is here: mdgriffith/elm-codegen#39

This is not a blocker though, I've decided to implement this case a little differently.
For the example above, the comment that gets generated looks like this:

{- | A simple message

## Fields
### field
A field containing a string
-}

This is now live in version 3.1.0 and above :)

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

No branches or pull requests

1 participant