GithubHelp home page GithubHelp logo

Comments (12)

krasa avatar krasa commented on July 2, 2024

#43 will fix it afaik, and btw this issue effectively kills the ide performance.

from intellij-plugin-save-actions.

ccsplit avatar ccsplit commented on July 2, 2024

@krasa Thanks, for taking a look at this. I have tested your branch with the changes and the issue still exists. I have taken a look at the logs and everything seems to run correctly within the plugins (no errors). However, the logging messages continually repeat, therefore, I'm curious if there is something flooding the MessageBus with AppTopics.FILE_DOCUMENT_SYNC topics which SaveActionsManager is subscribed to causing it to continually process the same file.

from intellij-plugin-save-actions.

krasa avatar krasa commented on July 2, 2024

how do you reproduce it? I get at most 3 formatings per one save, which is bad, but certainly no infinite loop as before without the patch when 2 projects were opened...

from intellij-plugin-save-actions.

krasa avatar krasa commented on July 2, 2024

I think part of the problem is that I trigger saving of the file in Eclipse Formatter plugin for various reasons.

But perhaps it could be handled, if you do ReflectionToStringBuilder.toString(IdeEventQueue.getInstance().getTrueCurrentEvent())

then this is the good event:
java.awt.event.KeyEvent@7557a4bb[isProxyActive=false,keyCode=83,keyChar=�,keyLocation=1,when=1463598146868,modifiers=130,bdata={0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,83,0,0,0,0,0,0,0,1,0,31,0,0,0,0,0,-44,115,110,2,0,0,0,0,0,0,0,0,0,0,0,0},id=401,consumed=true]

and this is unwanted one which is probably triggered by my Eclipse Formatter:
java.awt.event.InvocationEvent@60aba7d[runnable=LaterInvocator.FlushQueue lastInfo=[runnable: com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$8$1@2a5967a4; state=ModalityState.NON_MODAL] ,notifier=<null>,catchExceptions=false,exception=<null>,throwable=<null>,when=1463598146963,bdata=<null>,id=1200,consumed=false]

from intellij-plugin-save-actions.

ccsplit avatar ccsplit commented on July 2, 2024

I simply have the comment within a test java class that looks like below and add spaces/change a letter, then save and it will continually happen. It's possibly some of the settings I have may be interacting with the saves causing it to happen more often than it should.

public class TestCodeFormat {
  /*
  private void printDeviceTree(CheckPointDevice device, String indent) {
    if (device == null) return;

    String text = device.getCpType().toString() + " " + device.getName() + ":" + device.getIpAddress();
    logger.error(indent + text);
    for (CheckPointDevice child : device.getChildren()) {
      printDeviceTree(child, indent + "  ");
    }
  }
  */
}

from intellij-plugin-save-actions.

krasa avatar krasa commented on July 2, 2024

Some other plugin could trigger it... Anyways, try this https://github.com/krasa/intellij-plugin-save-actions/tree/skipEvents

from intellij-plugin-save-actions.

ccsplit avatar ccsplit commented on July 2, 2024

@krasa This was indeed the case where there were many InvocationEvents causing it to reformat and skipEvents resolves the issue.

Thank you for your time.

from intellij-plugin-save-actions.

krasa avatar krasa commented on July 2, 2024

Well, it did not work for me entirely... for some reason I get also these, even with default formatter:
java.awt.event.InvocationEvent@2b426b13[runnable=LaterInvocator.FlushQueue lastInfo=[runnable: com.intellij.openapi.application.TransactionGuardImpl$7@5882d166; state=ModalityState.NON_MODAL] ,notifier=<null>,listener=<null>,dispatched=false,catchExceptions=false,exception=<null>,throwable=<null>,when=1463602498882,bdata=<null>,id=1200,consumed=false]

edit: so that is also triggered by automatic save, so it is a problem...

from intellij-plugin-save-actions.

krasa avatar krasa commented on July 2, 2024

#46

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on July 2, 2024

Is that still present? I never merged #46 because I couldn't figure out what it was for.

from intellij-plugin-save-actions.

ccsplit avatar ccsplit commented on July 2, 2024

It was present when I was working with my old company on the latest branch. However, worked when using Krasa's branch. So it is up to you whether you want to close the issue/merge.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on July 2, 2024

If someone needs it, reopen

from intellij-plugin-save-actions.

Related Issues (20)

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.