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

Generate documentation for error IDs #15265

Open
nicolasstucki opened this issue May 23, 2022 · 3 comments
Open

Generate documentation for error IDs #15265

nicolasstucki opened this issue May 23, 2022 · 3 comments

Comments

@nicolasstucki
Copy link
Contributor

We should generate the documentation @ckipp01 collected in index in an official part of the Scala 3 documentation. This list should be up to date with all the errors listed in ErrorMessageID.scala. A good way to make sure that the documentation is complete would be to make the IDs hold the explanations of the error messages. Not sure if those would be the same explanations that we have in Message.scala, if it is the case it would be simpler to maintain.

Originally posted by @nicolasstucki in #14965 (comment)

@pikinier20
Copy link
Contributor

We could reuse the tool that generates the index in Chris's repo and generate a static site that will be present in language reference

@nicolasstucki
Copy link
Contributor Author

Not sure if that is the most maintainable approach. We should also have something that forces us to create those examples when adding new error messages.

@pikinier20
Copy link
Contributor

Another idea would be to add docstring to each case in https://github.com/lampepfl/dotty/blob/73e635143bf68c388e4dc4d88054eca1dc3a09ea/compiler/src/dotty/tools/dotc/reporting/ErrorMessageID.scala which would have snippet with example. Generating documentation from this file with snippet checking would build a page where you could see an example with error message for each error ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants