Comments (6)
Unchecking these two settings seems to fix the undesired behavior
from intellij-buf.
We'll check this out, thanks for the bug report.
from intellij-buf.
@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.
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.
@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.
@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 (15)
- Ambiguous import google/protobuf/*** HOT 1
- Error using Buf plugin in IntelliJ 2023.2
- Register BUF configuration schemas HOT 4
- didn't work in Goland 2022.1.1 HOT 7
- Reformat Code on proto file introduces newlines at 8192 char intervals HOT 1
- File level lint warnings are not reported
- Improve quickfix for IMPORT_USED
- Allow custom path for the buf binary HOT 2
- Add a quick fix to ignore lint issues
- Google wellknowntypes showing error in GoLand / IntelliJ HOT 1
- buf.lock dependencies not resolving HOT 8
- Standardize repo with license headers, build steps, etc
- Automatically run `buf generate` when proto files are edited HOT 1
- Auto-import support for remote packages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intellij-buf.