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

mdoc:fail blocks are displaying incorrect error results #663

Closed
erikerlandson opened this issue Jul 10, 2022 · 1 comment · Fixed by #664
Closed

mdoc:fail blocks are displaying incorrect error results #663

erikerlandson opened this issue Jul 10, 2022 · 1 comment · Fixed by #664
Assignees

Comments

@erikerlandson
Copy link

I am running mdoc via sbt docs/tlSitePreview and the compiler is Scala 3.1.3

Here is a simple index.md file, with two different errors in a mdoc:fail block:

```scala mdoc:fail
val nope = "foo" * "goo"
```

```scala mdoc:fail
val bad = "moo" * "loo"
```

However, when I render it, the error from the first block re-appears in the 2nd block:

image

@tgodzik
Copy link
Contributor

tgodzik commented Jul 11, 2022

Thanks for reporting! I am looking into this, having some weird issues with the errors from the compiler, but I will try and dig in a bit more.

tgodzik added a commit to tgodzik/mdoc that referenced this issue Jul 11, 2022
Previously, we were using the same reporter for each fail section, which was causing no more errors to be reported on the next section.

Now, we reset the context before compiling, which is creating a new reporter each time and that was already done for `compile`

I also tidied it a bit to only use the currently available context which will be fresh on `reset` always.

Fixes scalameta#663
tgodzik added a commit to tgodzik/mdoc that referenced this issue Jul 12, 2022
Previously, we were using the same reporter for each fail section, which was causing no more errors to be reported on the next section.

Now, we reset the context before compiling, which is creating a new reporter each time and that was already done for `compile`

I also tidied it a bit to only use the currently available context which will be fresh on `reset` always.

Fixes scalameta#663
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 a pull request may close this issue.

2 participants