Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.16k stars 303 forks source link

Right Pane doesn't update when reloading a file #1788

Open snwbrdr1274 opened 8 years ago

snwbrdr1274 commented 8 years ago

Short Summary

The right pane will lose anything listed under the file heading after reloading a file that has been changed from another source. In perl, all functions are no longer displayed after the file is reloaded in the IDE.

Steps to Reproduce

1) Open a file in the IDE. 2) Open another file and have that as the current file displayed. 3) Open the same file in another editor like vim, gedit, etc. 4) Make a change to the file and save it. 5) Go back to the Komodo IDE and select OK to reload the file. 6) Switch to the file tab that was edited. 7) Anything listed in the right pane (functions, variables) will no longer be displayed.

Expected results

When the file is parsed, all functions and variables are properly listed in the right pane.

Actual results

The right pane only contains the file name.

Platform Information

Komodo Edit or IDE? Komodo IDE Komodo Version? 10.0.1, build 89237, platform linux-x86_64 Operating System (and version)? Linux Ubuntu LTS 14 64 bit

Additional Information

If the file that gets reloaded is the visible file tab, then the right pane will correctly populate.

mitchell-as commented 8 years ago

@cgchoffman were you able to reproduce this? I am not.

  1. I created a very simple Python file:
def foo():
    pass
def bar():
    pass
def baz():
    pass
  1. I opened that file in Komodo and opened the code browser. I see all three functions.
  2. I switched to another tab in order to clear the code browser.
  3. I edited the file outside Komodo and added another function:
def qux():
    pass
  1. I switched back to Komodo and then back to the file.
  2. Komodo silently reloaded my file and populated the code browser with the 4th function.
th3coop commented 8 years ago

I reproduced only ONCE by following @snwbrdr1274' steps:

Code pane loses all content except the filename. I have to close and reopen the file to get content back to the Code Pane.

I tried to reproduce twice in a row and it no longer happens. The Code is always populated, even after the file reloads external changes.

snwbrdr1274 commented 8 years ago

Using the python file above, I was not able to reproduce either. I am able to do this with several perl files - not sure if it has anything to do with the size of them or not. Using a small quick test perl file that only had a couple of sub routines I was not able to reproduce.

mitchell-as commented 8 years ago

@snwbrdr1274 Thanks for the extra input. I'll give it a try with larger perl files and see if that triggers the problem.

mitchell-as commented 8 years ago

Confirmed. Thanks again for your patience.

mitchell-as commented 8 years ago

Note to self: this only happens once per Komodo instance. (You must restart Komodo to trigger it again, at least for the same file.) The file may be either visible or invisible. Once the file is modified outside Komodo, Komodo will immediately reload the file in the background (this is clearly evident if the file is under SCC -- its tab will turn blue). Upon switching back to Komodo or to the changed file, the code browser will be blank. (Switching back too fast will not exhibit this problem.) Typing into the file will repopulate the browser as expected. When attempting to do these steps again, the code browser will be updated properly.

mitchell-as commented 7 years ago

Re-assigning to @Naatan. The file needs to be re-scanned after reloading its contents. When you follow the steps in https://github.com/Komodo/KomodoEdit/issues/1788#issuecomment-232161207, the symbol browser is not updated. Only after switching between tabs does the symbol browser update properly.