Skip to content

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

Merged
bracevac merged 11 commits into
scala:mainfrom
i10416:docs/apply-snippet-check-on-new-types
Mar 9, 2026
Merged

docs: apply snippet compiler on new types reference docs#19513
bracevac merged 11 commits into
scala:mainfrom
i10416:docs/apply-snippet-check-on-new-types

Conversation

@i10416

@i10416 i10416 commented Jan 22, 2024

Copy link
Copy Markdown
Contributor

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

i10416 commented Jan 22, 2024

Copy link
Copy Markdown
Contributor Author

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

Comment thread docs/_docs/reference/new-types/match-types.md Outdated
Comment thread docs/_docs/reference/new-types/polymorphic-function-types.md Outdated
Comment thread docs/_docs/reference/new-types/dependent-function-types.md Outdated
Comment thread docs/_docs/reference/new-types/dependent-function-types.md Outdated
undo unnecessary changes
Comment thread docs/_docs/reference/new-types/union-types.md Outdated
@i10416

i10416 commented Jan 23, 2024

Copy link
Copy Markdown
Contributor Author

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

i10416 commented Jan 23, 2024

Copy link
Copy Markdown
Contributor Author

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 previously requested changes Feb 1, 2024
Comment thread project/Build.scala Outdated
@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
@Gedochao Gedochao added the stat: stale PR Marks any stale PRs, if no response is given, the PR qualifies as a one to close. label Feb 24, 2026
@Gedochao

Copy link
Copy Markdown
Contributor

@i10416 What is the status of this PR? Do you mean to work on it in the near future, or should we close it?

@Gedochao

Gedochao commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Bump.
Similar case to #19498
@sjrd @bracevac is it still relevant?

@bracevac

bracevac commented Mar 2, 2026

Copy link
Copy Markdown
Member

Same comment as in the other PR.

@Gedochao
Gedochao marked this pull request as draft March 2, 2026 12:31
@Gedochao Gedochao assigned Gedochao and unassigned i10416 Mar 2, 2026
@Gedochao Gedochao removed the stat: stale PR Marks any stale PRs, if no response is given, the PR qualifies as a one to close. label Mar 2, 2026
@Gedochao
Gedochao force-pushed the docs/apply-snippet-check-on-new-types branch from c79c30b to ab6a0ad Compare March 2, 2026 12:56
@Gedochao

Gedochao commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Merged main back here and solved conflicts, should be done again after #19498 gets merged

@Gedochao Gedochao added the needs-squashing PR whose commits should be squashed by the author or via the "Squash and Merge" button label Mar 2, 2026
@bracevac

bracevac commented Mar 2, 2026

Copy link
Copy Markdown
Member

Here, we should more carefully go over the changes, as some snippets received more context, which we might want to put between the magic comments //{ //} to hide them.

@Gedochao

Gedochao commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

I'll see what I can do

@Gedochao
Gedochao force-pushed the docs/apply-snippet-check-on-new-types branch from 44a9fb0 to 706f7d7 Compare March 3, 2026 09:03
@Gedochao
Gedochao marked this pull request as ready for review March 3, 2026 09:29
@Gedochao
Gedochao requested review from bracevac and sjrd and removed request for sjrd March 3, 2026 09:29
@Gedochao Gedochao assigned bracevac and unassigned Gedochao Mar 3, 2026
@Gedochao

Gedochao commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Should be ready for re-review

@sjrd
sjrd dismissed their stale review March 3, 2026 09:40

Stale.

@Gedochao

Gedochao commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Bump @bracevac

@bracevac
bracevac merged commit 122fd6a into scala:main Mar 9, 2026
62 checks passed
@WojciechMazur WojciechMazur added this to the 3.8.4 milestone Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-squashing PR whose commits should be squashed by the author or via the "Squash and Merge" button

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants