Editors not refreshed upon metadata refresh

Issue #611 resolved
Eric Alexander created an issue

If an editor window is open and not dirty and you retrieve or refresh the metadata the files currently open do not update.

You can spend a while typing and then when you try to save you get the load file system changes message. You are left with choosing to load file system, undo, copy, redo, and paste to get things back in sync.

I would propose if the open files are not dirty they are reloaded immediately. Also, need to take into account the possibility a different opened file was saved then does it mark the other open files as not dirty cause you have to force save them....Can you check timestamps? Either way, the delay causes issues....

Comments (13)

  1. Scott Wells repo owner

    Yeah, that would definitely be a bug. I force IntelliJ to refresh its virtual file system at the end of retrieve and refresh operations, and it should also do so upon receiving focus (unless you've turned off that config setting in the base IDE). It should be managing all of that for me. It will also detect if you start editing a file that has changed in the underlying physical filesystem and prompt whether to merge, use file system, or use local. If it's not doing that properly, I need to look into that ASAP. Let me see if I can reproduce it. If not I'll reach out to you to see what steps I'm missing.

  2. Eric Alexander reporter

    I know I changed a settings to stop it from compiling when loosing focus as with the delays in compiling I did not what to wait 1-90 minutes for a deployment to complete just because I switched windows.

    I cannot find that setting now though.

    Where is the setting in the IDE for receiving focus? I will check that...

    I have "Synchronize files on frame or editor tab activation" set to true.

    Closing and opening the editor tab does not force refresh the contents either in my case just fyi.

  3. Scott Wells repo owner

    Settings>Appearance & Behavior>System Settings under the Synchronization section. If you've switched to Override Save All action, you can safely change those back to defaults without fear of unintentional deployment. The defaults are Synchronize files on frame or editor tab activation checked, Save files on frame deactivation checked, Save files automatically... unchecked, and Use "safe write" checked.

  4. Eric Alexander reporter

    I have Save files on frame deactivation set to false. Do not think that would be the cause of this issue though.

  5. Scott Wells repo owner

    Eric, would you mind reproducing this with the following configured for debug logging?

    #com.illuminatedcloud.intellij.builder.ForceComMetadataRetriever
    

    Then please send me your idea.log so I can see why it doesn't seem to be refreshing for you properly after a retrieve/refresh operation.

  6. Eric Alexander reporter

    Here you go

    Steps I took

    1. Opened class in Idea editor
    2. Went to SF and updated the clas
    3. Right clicked on the class in Idea and selected “Retrieve Metadata”
    4. Retrieved it
    5. Editor did not update
    6. Added a comment in the editor
    7. Prompt came up asking if I wanted to load file system changes
    8. All my changes made in #6 were removed and updates from SF were loaded
  7. Scott Wells repo owner

    Thanks, Eric! I'll take a look shortly and will hopefully see the smoking gun in that log. I'll let you know what I find.

  8. Scott Wells repo owner

    I've now seen this on a few folks' machines, and always on Macs. I'll need to debug this a bit on my Mac to see if I can figure out what's going on. Hopefully I'll include a fix for it soon.

  9. Scott Wells repo owner

    Issue tracker grooming. If this is still happening, please feel free to reopen, ideally with a concrete reproduction scenario.

  10. Log in to comment