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

Fix crash block capturing expressions #551

Merged
merged 6 commits into from
Aug 24, 2021

Conversation

keynmol
Copy link
Collaborator

@keynmol keynmol commented Aug 23, 2021

Closes #527

Putting this on CI to make sure it's not my laptop that is behaving weirdly (it fixes the original issue, btw)

TODO:

  • Correct position capturing? "Starts at the beginning of first statement, ends at the end of the last one"

@@ -12,6 +12,7 @@ import mdoc.Reporter
import mdoc.internal.cli.InputFile
import java.nio.file.Path
import mdoc.internal.cli.Settings
import scala.collection.immutable
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import scala.collection.immutable

.append(") {\n")

section.source.stats.foreach { stat =>
sb.append(stat.pos.text).append("\n")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to add a semicolon just in case.

Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@keynmol
Copy link
Collaborator Author

keynmol commented Aug 23, 2021

I'm just fighting exact same problem as @tgodzik was: #512 (comment)

@keynmol keynmol merged commit ad331b2 into scalameta:main Aug 24, 2021
@keynmol keynmol deleted the fix-crash-block branch August 24, 2021 12:28
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.

mdoc puts each Statement in a different block when using crash
2 participants