Comments (12)
Thanks for that. Can you give me your plugin version, idea version and the last lines of your ~/.IntelliJIdea2016.1/system/log/idea.log please I'll check it out
from intellij-plugin-save-actions.
I can reproduce, don't worry about what I asked you, I'll be able to manage without it.
edit: I went back as far as v0.4, and that bug was always there and it is pretty serious. The problem is that I don't know when the file is written to disk, it seems like it is written too soon (before the plugin has finished working on the file) because it is done async.
edit2: actually not too bad since in the end the correct content is written to disk, but a bit later, I'll see if I can force it
from intellij-plugin-save-actions.
I've seen the same thing, but when I save the file the unformatted version gets written to disk.
First save: writes unformatted version to disk
Second save: writes formatted version to disk.
This only happens when the code needs to be formatted. If I type out a line of code and got the formatting correct myself, then it properly writes to disk the first time.
IntelliJ 2017.2
Save Action 0.16
Relevant preferences: Reformat File
and Reformat only changed code (only if VCS configured)
are both checked
from intellij-plugin-save-actions.
Thanks for the comment. I know this issue still exists but I haven't got around to fixing it. It also doesn't seem to happen all the time, but I definitely see it once in a while (when I commit to git then see a formatting change after the commit).
I'm pretty sure it has to do with multiple save event being thrown. I'm linking this old PR that filters duplicate events, it might help in that case: https://github.com/dubreuia/intellij-plugin-save-actions/pull/46/commits
from intellij-plugin-save-actions.
This is a problem also when building / executing tests. It does: "build -> save actions -> tests -> fail with stack trace -> the stack trace lines are the old ones" (meaning the file was not saved at the proper time)
from intellij-plugin-save-actions.
I also have this issue with the most basic of settings
from intellij-plugin-save-actions.
Hey @blowsie, thanks for reporting.
I know about this problem but I've been unable to fix it. It has something to do with how Intellij handles a file's life cycle. I'll probably find a way at some point but for now it doesn't work.
You can also see the problem with "Organize imports": if you have an unused import that is also a compile error (for example on a class that doesn't exists anymore), building the project will trigger save actions, that will clean the unused (and erroneous) import, but the build will still fail on the import that doesn't exist anymore. It happens to me a lot when I refactor code.
This is really annoying. If I get time at some point I'll seek help from Jetbrains.
from intellij-plugin-save-actions.
Hey folks. This probably also happens when you use the feature to undo changes ("Rollback Lines") on the left panel. With this technique I can reproduce the described behaviour very consistently.
So maybe this helps to debug?
- Open a file that is commited to VCS
- Write a new line: new MalformedParameterizedTypeException();
- Notice on the left a green mark that there is a new added line
- Click on the green mark and undo the changes
- The now unused import of MalformedParameterizedTypeException will stay
from intellij-plugin-save-actions.
Thanks for the information @sniffertine. It is similar to the fact that the plugin triggers only once per file. I'm pretty sure intellij keeps a list of dirty files, and removing a line from VCS (green square on the left) probably doesn't make the file dirty. No sure it is a save action bug in that case.
from intellij-plugin-save-actions.
I don‘t know if thats an auto save bug. There is definitely a file saved to the FS, but if IntelliJ doesn‘t trigger an event for plugins you cannot do much indeed.
Maybe you could subscribe to VFS changes using an event listener and be notified on more detailed file events that the usage of FILE_DOCUMENT_SYNC through message bus.
--> https://www.jetbrains.org/intellij/sdk/docs/basics/virtual_file_system.html#virtual-file-system-events
from intellij-plugin-save-actions.
Might be fixed by #207, reopen if necessary
from intellij-plugin-save-actions.
Released in https://github.com/dubreuia/intellij-plugin-save-actions/releases/tag/v1.3.0
from intellij-plugin-save-actions.
Related Issues (20)
- StackOverlfow.
- CustomUnqualifiedStaticUsageInspection: display name should be overridden or configured via XML [Plugin: com.dubreuia] HOT 5
- bulk save action performance
- The specified parameters not match any of the following constructors: public com.dubreuia.model.Storage() HOT 1
- Exception in Save Actions 2.3.0 HOT 1
- Save Actions not working in WebStorm EAP version HOT 4
- Removal of required suppress warning annotation HOT 1
- Looking for gradle tasks integration option in save action plugin HOT 1
- Exception in IntelliJ 2023.1 HOT 1
- RuntimeException in IntelliJ 2023.1 HOT 21
- Cannot create configurable error on fresh plugin install HOT 7
- Cannot create configurable HOT 3
- Request: for "Reformat file" on save, please prevent it in case it changes logic or when the code has errors HOT 10
- Cannot save, launch, or commit changes, due to RuntimeException: Cannot invoke (class=SaveActionManager, method=beforeAllDocumentsSaving, topic=FileDocumentManagerListener) HOT 4
- Exception: Cannot create configurable HOT 2
- Can not commit git By idea2023.1 HOT 2
- Unexception: Save Actions occurs errors when starting tomcat server HOT 2
- com.intellij.diagnostic.PluginException: No display name is specified for configurable com.dubreuia.ui.Configuration in xml file HOT 2
- com.intellij.diagnostic.PluginException: No display name specified in plugin descriptor XML file for configurable com.dubreuia.ui.Configuration; specify it using 'displayName' or 'key' attribute to avoid necessity to load the configurable class when Settings dialog is opened [Plugin: com.dubreuia] HOT 3
- java.lang.RuntimeException: Cannot invoke (class=SaveActionManager, method=beforeAllDocumentsSaving, topic=FileDocumentManagerListener) HOT 1
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-plugin-save-actions.