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

docs: apply snippet compiler on new types reference docs #19513

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

i10416
Copy link
Contributor

@i10416 i10416 commented Jan 22, 2024

This commit addresses a part of #12967.

To make documents pass snippet checking, I modified some Scala code blocks while keeping original code as much as possible.

I guessed snippet check for docs raises "dotty.tools.dotc.MissingCoreLibraryException: Could not find package scala from compiler core libraries." on CI (not on my local machine), so I skipped adding docs to Build.scala, but it still fails 🤔

This commit addresses a part of scala#12967.

To make documents pass snippet checking, I modified some Scala code blocks while keeping original code as much as possible.

Snippet check for docs raises "dotty.tools.dotc.MissingCoreLibraryException: Could not find package scala from compiler core libraries." on CI(not on my local machine),
so I skip adding docs to Build.scala for now.
@i10416
Copy link
Contributor Author

i10416 commented Jan 22, 2024

Even when I do not change Build.scala, it fails 🤔

dotty.tools.dotc.MissingCoreLibraryException: Could not find package scala from compiler core libraries.
Make sure the compiler core libraries are on the classpath.

https://github.com/lampepfl/dotty/actions/runs/7616330659/job/20742843404?pr=19513

undo unnecessary changes
@i10416
Copy link
Contributor Author

i10416 commented Jan 23, 2024

I believe snippet checking has not been applied to docs/_docs/*. Why minor changes to code and code block metadata in docs result in error?

Before this commit, `generateReferenceDocumentation` failed with
MissingCoreLibraryException even though it didn't use snipet checking.

It turned out that `sc:fail` causes the problem, but I do not know
exact reason for this.

Nothing but snippet compiler should use the `sc:fail` metadata.
@i10416
Copy link
Contributor Author

i10416 commented Jan 23, 2024

It turned out that sc:fail causes the problem, but I do not know exact reason for this.
I believe generateReferenceDocumentation task hasn't used snippet compiler on documents. Otherwise, generateReferenceDocumentation should have always failed. Nevertheless, The presence of sc:fail causes the dotty.tools.dotc.MissingCoreLibraryException.

The change in unin-types-spec.md is workaround. It should be `sc:fail` instead of
`sc:nocompile`, but it causes generateReferenceDocumentation task to
fail with MissingCoreLibraryException.
i10416 added a commit to i10416/dotty that referenced this pull request Jan 23, 2024
This commit adds workaround for the MissingCoreLibraryException due to
`sc:fail` and enables snippet compiler on enums reference documents.

See scala#19513 (comment)
@nicolasstucki nicolasstucki requested review from Florian3k and sjrd and removed request for Florian3k February 1, 2024 08:27
@sjrd sjrd assigned i10416 and unassigned sjrd Feb 5, 2024
@i10416 i10416 force-pushed the docs/apply-snippet-check-on-new-types branch from 5276247 to 9039fce Compare February 9, 2024 18:52
@i10416 i10416 requested a review from sjrd February 14, 2024 18:11
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