Giter Site home page Giter Site logo

Comments (6)

Kryan90 avatar Kryan90 commented on May 19, 2024

Unchecking these two settings seems to fix the undesired behavior
image

from intellij-buf.

bufdev avatar bufdev commented on May 19, 2024

We'll check this out, thanks for the bug report.

from intellij-buf.

pkwarren avatar pkwarren commented on May 19, 2024

@Kryan90 - I'm not able to reproduce the issue with the steps above. Only when making a change to the open .proto file do I see that all files are auto saved, which triggers the 'Tools -> Actions on Save -> Reformat code' action to run 'go fmt' on the .go files.

Can you provide more details on the version of IntelliJ/GoLand you are using, the Buf plugin version, and anything else that might allow me to reproduce the problem on my end?

from intellij-buf.

Kryan90 avatar Kryan90 commented on May 19, 2024

buf plugin: 0.1.5
GoLand 2023.2 - Build #GO-232.8660.185, built on July 25, 202

It seems to happen within specific contexts, for example inside a function body or struct definition. I took a short video to demonstrate the behavior

Screen.Recording.2023-08-16.at.11.17.22.AM.mov

from intellij-buf.

pkwarren avatar pkwarren commented on May 19, 2024

@Kryan90 - Thanks for the additional context. I'm able to reproduce the behavior here, but even after some fixes to the plugin to reduce the saved documents to only .proto files, it appears that as part of running a background task there is another location in IntelliJ which triggers a save of all unsaved documents: https://github.com/JetBrains/intellij-community/blob/66b0623ced948ee43cb22e32ecaee1c791b22c1f/platform/configuration-store-impl/src/SaveAndSyncHandlerImpl.kt#L179-L180

Any save triggers the default 'Reformat code' action in Tools -> Actions on Save, which leads to the reformatting.

I'll continue to try and find a fix for this issue, however it may be more complex than I initially thought.

from intellij-buf.

pkwarren avatar pkwarren commented on May 19, 2024

@Kryan90 - The behavior should be much improved in version 0.2.1 (available now). There are some cases where you may still see auto-save trigger reformatting of Go code, but it should be much less frequent than before.

from intellij-buf.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.