Using the enclosed type to fix completion and imports for inner classes.

Make sure that the enclosing object is passed to the indexer also for modules.

Fix #1002002