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

BUILD file contents deleted when automatically formatted on save #6471

Open
chance-mongo opened this issue Jun 6, 2024 · 3 comments
Open
Labels
more-data-needed Awaiting response from issue author product: IntelliJ IntelliJ plugin topic: bazel Bazel integration (external repositories, aspects, flags, etc) type: bug

Comments

@chance-mongo
Copy link

Description of the bug:

Whenever I make a change to a BUILD file and then save, the file's contents are all deleted (see attached video).
Confirmed that this stops happening when the Bazel plugin's Automatically format BUILD files on save is turned off.

My best guess is that this is just some incompatibility between IDE version, plugin version, and bazel version? Maybe it's an interaction between the Bazel plugin's save action and IntelliJ's built in save action formatting?

Screen.Recording.2024-06-06.at.11.38.11.AM.mov

Which category does this issue belong to?

Intellij

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  1. Ensure Automatically format BUILD files on save is turned on
  2. Make a change to a BUILD file
  3. Save (cmd-s)
  4. The BUILD file contents are deleted

Which Intellij IDE are you using? Please provide the specific version.

2024.1.2

What programming languages and tools are you using? Please provide specific versions.

Java

What Bazel plugin version are you using?

2024.05.21.0.1-api-version-241

Have you found anything relevant by searching the web?

No, but this issue is kind of hard to google so possible there's something out there?

Any other information, logs, or outputs that you want to share?

No response

@chance-mongo chance-mongo added awaiting-maintainer Awaiting review from Bazel team on issues type: bug labels Jun 6, 2024
@github-actions github-actions bot added the product: IntelliJ IntelliJ plugin label Jun 6, 2024
@sgowroji sgowroji added the topic: bazel Bazel integration (external repositories, aspects, flags, etc) label Jun 7, 2024
@mai93
Copy link
Collaborator

mai93 commented Jun 12, 2024

I was not able to reproduce this with the plugin/IDE versions you mentioned, what os are you using the plugin on?

@mai93 mai93 added more-data-needed Awaiting response from issue author and removed awaiting-maintainer Awaiting review from Bazel team on issues labels Jun 12, 2024
@chance-mongo
Copy link
Author

chance-mongo commented Jun 12, 2024

I'm on 14.5 (23F79)
Also, not sure if the plugin uses the buildifier.json file behind the scenes, but ours is:

{
  "type": "auto",
  "mode": "check",
  "lint": "warn",
  "warningsList": ["-positional-args"]
}

And here's my bazel version as well:

Bazelisk version: v1.18.0
Build label: 6.5.0
Build target: bazel-out/darwin_arm64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jan 23 16:45:22 2024 (1706028322)
Build timestamp: 1706028322
Build timestamp as int: 1706028322

@mai93
Copy link
Collaborator

mai93 commented Jun 12, 2024

I think we do use the buildifier.json, https://github.com/bazelbuild/intellij/pull/6158/files.

Thanks for providing the extra details, I am still not able to reproduce it, when you run buildifier from command line does it result in the same issue? Also are you able to reproduce it with a simple project like the ones under https://github.com/bazelbuild/intellij/tree/master/examples

@mai93 mai93 removed their assignment Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-data-needed Awaiting response from issue author product: IntelliJ IntelliJ plugin topic: bazel Bazel integration (external repositories, aspects, flags, etc) type: bug
Projects
None yet
Development

No branches or pull requests

5 participants