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

Support for refreshing bsp projects on BUILD file change #502

Merged
merged 1 commit into from
Mar 12, 2020

Conversation

lukaszwawrzyk
Copy link
Contributor

There is already a file watcher that creates a popup notification with link to project refresh when BUILD file changes.
This PR updates the method that the hyperlink points to - PantsUtil.refreshAllProjects, so that in case of project imported from bsp rather than from pants, it would also refresh the project correctly.

Also the change in findBuildRoot was needed (look for pants root in module content roots if it was not found from .iml file) as otherwise the root module could not be found given layout generated by fastpass. Because of that the file watcher was never setup.

Copy link
Contributor

@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.

This is great! Thank you @lukaszwawrzyk for looking into this.

I'm wondering if we could somehow add a basic integration test that imports a Pants build via BSP? The "fastpass" command-line tool can be launched via coursier using a command like

./coursier launch \
  org.scalameta:metals_2.12:0.8.0+305-60af6828-SNAPSHOT \
  -r sonatype:snapshots \
  --main scala.meta.internal.pantsbuild.BloopPants -- \
  create --name refresh-projects --intellij src::

It's OK to skip it if you consider it's too much effort. We can open a separate ticket to track progress on adding BSP integration tests.

@wisechengyi
Copy link
Collaborator

Thanks, @lukaszwawrzyk !

@wisechengyi wisechengyi merged commit 9f38f76 into pantsbuild:master Mar 12, 2020
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.

4 participants