Skip to content

Deliver holes for literate Effekt files #1035

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

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

timsueberkrueb
Copy link
Contributor

Previously, we only published holes for .effekt but not for effekt.md. The reason for this is that for *.md files we construct a new MarkdownSource in compileSource and we attach the annotations to that, but we pass the old StringSource back to afterCompilation, meaning we don't find the annotations.
This PR fixes this issue by passing the correct source to afterCompilation.

@timsueberkrueb timsueberkrueb requested a review from jiribenes June 4, 2025 09:24
Copy link
Contributor

@jiribenes jiribenes left a comment

Choose a reason for hiding this comment

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

I honestly cannot tell what changed here -- the try shifted, but there's a lot of changes that don't seem related to what happened at all? Is there something I've missed in the new body of the try?

Comment on lines 38 to 43
override def compileSource(source: Source, config: EffektConfig): Unit = try {
val src = if (source.name.endsWith(".md")) { MarkdownSource(source) } else { source }
override def compileSource(source: Source, config: EffektConfig): Unit = {
val src = if (source.name.endsWith(".md")) {
MarkdownSource(source)
} else {
source
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This confused me at first since I couldn't tell what changed -- only the try got moved, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is hard to see indeed; indenting the code triggered a reformat by intelliJ. If you want I can try to use another tool to reproduce the change with smaller diff.
What changed is: src is being initialized before the try block, the statements in finally use src rather than source.

@timsueberkrueb timsueberkrueb force-pushed the deliver-holes-for-literate-files branch from 0156f9d to 6398ca6 Compare June 5, 2025 06:35
Copy link
Contributor

@jiribenes jiribenes left a comment

Choose a reason for hiding this comment

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

I think this is OK, but it's pretty hard to see if the try-catch-finally logic is 100% sound.
Feel free to merge if you're happy with this, @timsueberkrueb

@timsueberkrueb timsueberkrueb merged commit bd6a6c4 into master Jun 16, 2025
2 checks passed
@timsueberkrueb timsueberkrueb deleted the deliver-holes-for-literate-files branch June 16, 2025 15:11
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.

3 participants