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

Add missing GHC messages #473

Closed
wants to merge 1 commit into from
Closed

Conversation

xsebek
Copy link

@xsebek xsebek commented Dec 1, 2023

  • generate "Not documented" stub pages for known GHC error codes

This is done by using GHC.Types.Error.Codes.constructorCodes by @sheaf from https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10857 and making an index.md for each code using a script.

@xsebek
Copy link
Author

xsebek commented Dec 1, 2023

This is definitely not ideal, but at least it would help Google index the pages and suggest them instead of GHC tickets.

Maybe there are some plans for GHC 9.10 to improve this situation. If so, feel free to close this PR and update the parent Issue with that info. 🙂

Comment on lines +9 to +10
* [Submit documentation directly through GitHub's online editor](https://github.com/haskellfoundation/error-message-index/new/main/message-index/messages/GHC-0048/\?filename\=index.md\&value\=---%0Atitle%3A%20SHORT%20TITLE%0Asummary%3A%20ONE%20SENTENCE%20SUMMARY%0Aintroduced%3A%209.6.1%0Aseverity%3A%20CHOOSE%20ONE%3A%20warning%20error%0A---%0A%0APlease%20describe%20the%20meaning%20of%20the%20error%20here%2C%20formatted%20in%20Markdown.)
* [Add documentation or examples on your own computer](https://github.com/haskellfoundation/error-message-index/blob/main/CONTRIBUTING.md) and send a pull request
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems I overlooked how good the current 404 template is - if this was used instead, then the GHC number inside the online editor link needs to be generated too.

@BinderDavid
Copy link
Collaborator

Thanks a lot for taking up this issue :) It is important to get this done 👍

I am not yet convinced that adding the missing errors as markdown index.md files to the repository is the technically best solution. This approach will make it more difficult if we want to change the wording for any of the missing errors since we have to write a new script which modifies all these files.
It will also make it more difficult to add new missing errors that will be added in future releases of GHC, since the script that you used to generate these messages is not part of the repo.

But hakyll which we use as a static site generator is super flexible when it comes to generating pages from arbitrary functions written in Haskell. So I think we can just rebuild the logic of your script within our site.hs and add one single file MissingErrors.txt to the repository which contains the output of the ghc script. In that way we can easily extend the list of missing error messages, and we can also programmatically change how we want to present missing error messages.

@xsebek xsebek closed this Sep 10, 2024
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.

Do undocumented error number pages simply not exist?
2 participants