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

Cleanup BSP server implementation #2814

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Conversation

lolgab
Copy link
Member

@lolgab lolgab commented Oct 2, 2023

  • Avoid BSP server integration when generating the semanticdb data
  • Make BSPCompileProblemReporter thread unsafe since can be called from a single thread (the Scala compiler is single threaded, now only one compilation has BSP and every module gets its own instance)
  • Start sending partial events to BSP using reset = false when the compiler reports a problem. Before we were sending all the issues every time, by using the reset = true flag. Now we send one problem at a time using reset = false and at the end of the compilation we send them all using reset = true (which happens in fileVisited)

- Avoid BSP server integration when generating the semanticdb data
- Make BSPCompileProblemReporter thread unsafe since can be called from
  a single thread (the Scala compiler is single threaded, now only one
  compilation has BSP and every module gets its own instance)
- Start sending partial events to BSP using `reset = false` when the
  compiler reports a problem. Before we were sending all the issues
  every time, by using the `reset = true` flag. Now we send one problem
  at a time using `reset = false` and at the end of the compilation we
  send them all using `reset = true` (which happens in `fileVisited`)
Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

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

Is T.reporter now useful for anything? Should we deprecate it?

@lolgab
Copy link
Member Author

lolgab commented Oct 3, 2023

I think it can be useful in the future if we want to avoid allocating a BSPCompileProblemReporter for every compilation but reuse the same instance. In any case, we can deprecate it later if we want.

@lolgab lolgab marked this pull request as ready for review October 3, 2023 07:54
Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

@lefou lefou merged commit 72f0932 into com-lihaoyi:main Oct 3, 2023
37 checks passed
@lefou lefou added this to the 0.11.5 milestone Oct 3, 2023
@lolgab lolgab deleted the bsp-cleanup branch October 3, 2023 08:32
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