Menu

#857 completions not cleared when source directory removed

open-fixed
5
2009-02-20
2009-02-19
No

I am contributing a path entry to the project path via the pythonpath_contrib extension. When I add a directory to the contribution and do a PythonNature.rebuildPath(), the completions from the directory show up as expected. However, if I remove the directory, the new suggestions don't disappear, so they are cached somewhere. It looks to me like a new CompletionCache is constructed when rebuildPath() is called, so maybe the problem is further down, in PythonCompletionProcessor.

See this forum thread for more info: https://sourceforge.net/forum/message.php?msg_id=6468178

Discussion

  • Fabio Zadrozny

    Fabio Zadrozny - 2009-02-19

    PythonCompletionProcessor is only a user of that info... The nature (actually its module manager) is the place that should be looked for that.

    IModulesManager should implement something as a way to clear the caches and rebuildPath should call it.

    So, the idea is something as:

    rebuildPath() also calls clearCache() from the PythonNature, which calls it for the ast manager and which ends up calling for the modules manager -- which is the place that is actually holding that cache.

    Note that the clearCache() actually already exists in the ModulesManager (it's called from Ctrl+2+kill), so, it's only a matter of actually calling it when needed.

     
  • ddoubledaysf

    ddoubledaysf - 2009-02-20

    Patch for this bug

     
  • ddoubledaysf

    ddoubledaysf - 2009-02-20

    I added a patch that seems to work but may not be complete. The change is to add clearCache() to setProject(IProject) in ProjectModulesManager, which is called from ASTManager.setProject(IProject), which is called from the RebuildPythonNatureModules Job that is launched by rebuildPath().

    The reason I say maybe not complete? is that I am not a Jython user. The setProject() method in JavaProjectModulesManager just throws NotImplemented, so how does this work for Jython users?

     
  • ddoubledaysf

    ddoubledaysf - 2009-02-20
    • status: open --> pending
     
  • ddoubledaysf

    ddoubledaysf - 2009-02-20
    • status: pending --> open-fixed
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.