Skip to content

Scaladoc Support for Capture & Separation Checking #23471

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

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

bracevac
Copy link
Contributor

@bracevac bracevac commented Jul 3, 2025

[skip ci]

This'll fix #23437 (eventually, patience plz)

The PR should not be merged as such, since there are a few additions
and changes to the build files as well as development files & folders that do not belong into the main branch.

TODOs

  • Rendering of capture sets
  • Rendering of various arrows
    • Clarify: Include context function arrows?
    • Clarify: Are arrows without any capture annots by default pure?
    • Fix rendering logic for dependent function arrows
    • Test polymorphic functions
  • Rendering of paths in capture sets
  • Rendering of reach capabilities
  • Rendering of capture variables
    • Rendering of capture members
    • Rendering of the hat symbol on polymorphic funs
    • Rendering of the hat in HK types
  • Rendering of update
  • Rendering of @consume, @use
  • Rendering of .rd
  • Test type refinements
  • Fix some minor rendering bugs with paths and parameters

I think for now, let's have a separate API doc for CC enabled. A follow-up PR can investigate how to have one doc and a toggle on the page. This also depends to some extent on the effort to have a Scala 3 library artifact #22043 as well as having the rest of the standard library capture checked.

Trying it Out

  1. Scala 2 library CC (slow): Just run scaladoc/generateScalaDocumentation in sbt, go to ./scaladoc/output, and run an HTTP server from there to browse the API for the capture-checked stdlib.
  2. Small example project (faster) located in ./local/project. In sbt, invoke myrefresh which will compile the example project and then run scaladoc on it. The scaladoc output is in ./local/api and can be viewed using a local HTTP server.
    • If you change the example project, always run myrefresh afterwards for the up-to-date scaladoc.
    • If you changed the scaladoc source, but did not touch the example project, it suffices to run myscaladoc in sbt.

@bracevac bracevac changed the title Trying Scaladoc + scala2-library-cc Scaladoc Support for Capture & Separation Checking Jul 6, 2025
bracevac added 6 commits July 7, 2025 01:08
The information that we are within a capture context was not
propperly passed to recursive calls of `inner`, which caused
some types to be rendered incorrectly.

This was due to a bad interplay with implicit parameters
and default arguments.
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.

Scaladoc Support for Capture Checking
1 participant