bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://ij.bazel.build/
Apache License 2.0
764 stars 305 forks source link

"Refreshing files" step during "Bazel Sync" takes a long time #3182

Closed ronilichtman closed 1 year ago

ronilichtman commented 2 years ago

When syncing my project, my IDE hangs for significant time >10-minutes on the "Refreshing files" log. When tracking file system operations with dtruss, I see that GoLand is walking the node_modules directory. A few questions on this:

  1. Is it possible to exclude node_modules explicitly from the file traversal?
  2. This occurs each and every time I sync, even when I sync a single GoLang file. Is there any support for incremental syncs?

Details:

  1. My team uses a monorepo, majority of our backend is GoLang, frontend is NodeJS. All code is managed by Bazel (frontend and backend).
  2. I am using GoLand 2021.2
  3. I am using Bazel Plugin 2021.11.09.0.2-api-version-212

Thanks!

ronilichtman commented 2 years ago

I managed to significantly improve sync runtime (to under 10-seconds) by turning off the BlazeGoAdditionalLibraryRootsProvider as follows:

  1. Go to Help -> Edit Custom Properties... in IntelliJ.
  2. Adding
    use.go.additional.library.roots.provider4=false
  3. Restart GoLand

I'm not sure why the additional library roots provider is necessary, but from a shallow run through some files in the IDE, it appears that things are working well after this config change.

sgowroji commented 2 years ago

Hello @ronilichtman, Could you please respond if you still see the same with the latest release of Goland and bazel plugin. Thanks!

ShreeM01 commented 1 year ago

Hi there! Thank you for raising this issue. We're doing a clean up of old issues and will be closing this one since it seems to have stalled. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.