Skip to content

Conversation

@WojciechMazur
Copy link
Contributor

Extracted from #24734
Adds support for sc-opts: attribute that can be set in Markdown code snippets, allowing to pass additioanl arguments to snippet compiler.
This would allow us in #24734 to correctlly document behaviour of snippets producing error codes that require additional compiler options to be activated.

Example: ensure that -Werror makes given code to actually fail which can be checked with sc:fail,

 ```scala sc:fail sc-opts:-Werror,-explain
def exampleShouldError(input: Option[String]): Unit = 
  input match
    case Some("foo") => ???   
```.

@WojciechMazur WojciechMazur merged commit 7eba9a7 into scala:main Dec 15, 2025
46 checks passed
@WojciechMazur WojciechMazur deleted the scaladoc/snippet-options branch December 15, 2025 18:34
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